Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

From: Haitao Huang
Date: Thu Jan 04 2024 - 16:02:31 EST


On Thu, 04 Jan 2024 13:27:07 -0600, Dave Hansen <dave.hansen@xxxxxxxxx> wrote:

On 1/4/24 11:11, Haitao Huang wrote:
If those are OK with users and also make it acceptable for merge
quickly, I'm happy to do that 🙂

How about we put some actual numbers behind this? How much complexity
are we talking about here? What's the diffstat for the utterly
bare-bones implementation and what does it cost on top of that to do the
per-cgroup reclaim?


For bare-bone:

arch/x86/Kconfig | 13 ++++++++++++
arch/x86/kernel/cpu/sgx/Makefile | 1 +
arch/x86/kernel/cpu/sgx/epc_cgroup.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
arch/x86/kernel/cpu/sgx/epc_cgroup.h | 39 +++++++++++++++++++++++++++++++++++
arch/x86/kernel/cpu/sgx/main.c | 41 ++++++++++++++++++++++++++++++++++++
arch/x86/kernel/cpu/sgx/sgx.h | 5 +++++
include/linux/misc_cgroup.h | 42 +++++++++++++++++++++++++++++++++++++
kernel/cgroup/misc.c | 52 +++++++++++++++++++++++++++++++---------------
8 files changed, 281 insertions(+), 16 deletions(-)

Additional for per-cgroup reclaim:

arch/x86/kernel/cpu/sgx/encl.c | 41 +++++++++--------
arch/x86/kernel/cpu/sgx/encl.h | 3 +-
arch/x86/kernel/cpu/sgx/epc_cgroup.c | 224 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
arch/x86/kernel/cpu/sgx/epc_cgroup.h | 18 ++++++--
arch/x86/kernel/cpu/sgx/main.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------
arch/x86/kernel/cpu/sgx/sgx.h | 85 +++++++++++++++++++++++++++++++++--
6 files changed, 480 insertions(+), 117 deletions(-)


Thanks
Haitao