both work properly with all pages tracked in per-cgroup LRUs.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V10:
- Add comment to clarify each page belongs to one
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V8:
- Limit text width to 80 characters to be consistent.
V6:
- Remove mentioning of VMM specific behavior on handling SIGBUS
- Remove statement of forced reclamation, add statement to specify
ENOMEM returned when no
/blob/main/README
Signed-off-by: Haitao Huang
---
V7:
- Added memcontrol test.
V5:
- Added script with automatic results checking, remove the interactive
script.
- The script can run independent from the series below.
---
.../selftests/sgx/run_epc_cg_selftests.sh | 246 ++
.../sel
On Thu, 22 Feb 2024 16:24:47 -0600, Huang, Kai wrote:
On 23/02/2024 9:12 am, Haitao Huang wrote:
On Wed, 21 Feb 2024 04:48:58 -0600, Huang, Kai
wrote:
On Wed, 2024-02-21 at 00:23 -0600, Haitao Huang wrote:
StartHi Kai
On Tue, 20 Feb 2024 03:52:39 -0600, Huang, Kai
wrote
: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
---
V7:
- Split this out from the big patch, #10 in V6. (Dave, Kai)
---
arch/x86/kernel/cpu/sgx/main.c | 30
On Wed, 27 Mar 2024 11:56:35 -0500, Jarkko Sakkinen
wrote:
On Wed Mar 27, 2024 at 2:55 PM EET, Jarkko Sakkinen wrote:
On Mon, 2024-02-05 at 13:06 -0800, Haitao Huang wrote:
> The scripts rely on cgroup-tools package from libcgroup [1].
>
> To run selftests for epc cgroup:
On Wed, 27 Mar 2024 19:57:26 -0500, Haitao Huang
wrote:
On Wed, 27 Mar 2024 11:56:35 -0500, Jarkko Sakkinen
wrote:
On Wed Mar 27, 2024 at 2:55 PM EET, Jarkko Sakkinen wrote:
On Mon, 2024-02-05 at 13:06 -0800, Haitao Huang wrote:
> The scripts rely on cgroup-tools package from libcgr
On Wed, 27 Mar 2024 07:55:34 -0500, Jarkko Sakkinen
wrote:
On Mon, 2024-02-05 at 13:06 -0800, Haitao Huang wrote:
The scripts rely on cgroup-tools package from libcgroup [1].
To run selftests for epc cgroup:
sudo ./run_epc_cg_selftests.sh
To watch misc cgroup 'current' chan
On Sat, 30 Mar 2024 06:15:14 -0500, Jarkko Sakkinen
wrote:
On Thu Mar 28, 2024 at 5:54 AM EET, Haitao Huang wrote:
On Wed, 27 Mar 2024 07:55:34 -0500, Jarkko Sakkinen
wrote:
> On Mon, 2024-02-05 at 13:06 -0800, Haitao Huang wrote:
>> The scripts rely on cgroup-tools package from
On Sun, 31 Mar 2024 11:19:04 -0500, Jarkko Sakkinen
wrote:
On Sat Mar 30, 2024 at 5:32 PM EET, Haitao Huang wrote:
On Sat, 30 Mar 2024 06:15:14 -0500, Jarkko Sakkinen
wrote:
> On Thu Mar 28, 2024 at 5:54 AM EET, Haitao Huang wrote:
>> On Wed, 27 Mar 2024 07:55:34 -0500, Jarkko
Make cgroup test scripts ash compatible.
Remove cg-tools dependency.
Add documentation for functions.
Tested with busybox on Ubuntu.
Signed-off-by: Haitao Huang
---
tools/testing/selftests/sgx/ash_cgexec.sh | 58 ++
.../selftests/sgx/run_epc_cg_selftests.sh | 171
On Mon, 01 Apr 2024 09:22:21 -0500, Jarkko Sakkinen
wrote:
On Sun Mar 31, 2024 at 8:44 PM EEST, Haitao Huang wrote:
Make cgroup test scripts ash compatible.
Remove cg-tools dependency.
Add documentation for functions.
Tested with busybox on Ubuntu.
Signed-off-by: Haitao Huang
I'l
Make cgroup test scripts ash compatible.
Remove cg-tools dependency.
Add documentation for functions.
Tested with busybox on Ubuntu.
Signed-off-by: Haitao Huang
---
v2:
- Fixes for v2 cgroup
- Turn off swapping before memcontrol tests and back on after
- Add comments and reformat
---
tools
On Tue, 02 Apr 2024 06:58:40 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 2, 2024 at 2:23 PM EEST, Michal Koutný wrote:
Hello.
On Sat, Mar 30, 2024 at 01:26:08PM +0200, Jarkko Sakkinen
wrote:
> > > It'd be more complicated and less readable to do all the stuff
without the
> > > cgroup-tool
On Tue, 02 Apr 2024 02:43:25 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 2, 2024 at 4:42 AM EEST, Haitao Huang wrote:
Make cgroup test scripts ash compatible.
Remove cg-tools dependency.
Add documentation for functions.
Tested with busybox on Ubuntu.
Signed-off-by: Haitao Huang
---
v2
On Tue, 02 Apr 2024 12:40:03 -0500, Michal Koutný wrote:
On Tue, Apr 02, 2024 at 11:20:21AM -0500, Haitao Huang
wrote:
Do we really want to have it implemented in c?
I only pointed to the available C boilerplate.
There are much fewer lines of
code in shell scripts. Note we are not
On Thu, 04 Apr 2024 06:16:54 -0500, Huang, Kai wrote:
On Wed, 2024-03-27 at 17:22 -0700, Haitao Huang wrote:
void sgx_cgroup_init(void)
{
+ sgx_cg_wq = alloc_workqueue("sgx_cg_wq", WQ_UNBOUND | WQ_FREEZABLE,
WQ_UNBOUND_MAX_ACTIVE);
+
+ /* All Cgroups functionalities ar
Hi Kai,
Thanks for your suggestions. I'll adopt most of it as it.
Minor details below.
On Wed, 03 Apr 2024 08:08:28 -0500, Huang, Kai wrote:
On Wed, 2024-03-27 at 17:22 -0700, Haitao Huang wrote:
From: Kristen Carlson Accardi
When a cgroup usage reaches its limit, and it is to be ch
On Thu, 28 Mar 2024 07:53:45 -0500, Huang, Kai wrote:
--- /dev/null
+++ b/arch/x86/kernel/cpu/sgx/epc_cgroup.c
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright(c) 2022 Intel Corporation.
It's 2024 now.
And looks you need to use C style comment for /* Copyright ... */, af
On Mon, 08 Apr 2024 07:20:23 -0500, Huang, Kai wrote:
--- a/arch/x86/kernel/cpu/sgx/epc_cgroup.h
+++ b/arch/x86/kernel/cpu/sgx/epc_cgroup.h
@@ -28,6 +28,10 @@ static inline int sgx_cgroup_try_charge(struct
sgx_cgroup *sgx_cg, enum sgx_recl
static inline void sgx_cgroup_uncharge(struct sgx
On Mon, 08 Apr 2024 17:37:10 -0500, Huang, Kai wrote:
On 9/04/2024 6:03 am, Haitao Huang wrote:
The misc root cgroup is a static similar to sgx_cg_root. So
misc_cg_root() won't be NULL
However, based on how css_misc() was check NULL, I suppose
sgx_get_current_cg() may be NULL
On Tue, 09 Apr 2024 04:03:22 -0500, Michal Koutný wrote:
On Mon, Apr 08, 2024 at 11:23:21PM -0500, Haitao Huang
wrote:
It's always non-NULL based on testing.
It's hard for me to say definitely by reading the code. But IIUC
cgroup_disable command-line only blocks operations
12]v7:
https://lore.kernel.org/linux-sgx/20240122172048.11953-1-haitao.hu...@linux.intel.com/T/#t
[13]v8:
https://lore.kernel.org/linux-sgx/20240130020938.10025-1-haitao.hu...@linux.intel.com/T/#t
[14]v9:
https://lore.kernel.org/lkml/20240205210638.157741-1-haitao.hu...@linux.intel.com/T/
[15]v10:
ht
Replace boolean parameters for 'reclaim' in the function
sgx_alloc_epc_page() and its callers with an enum.
Also opportunistically remove non-static declaration of
__sgx_alloc_epc_page() and a typo
Signed-off-by: Haitao Huang
Suggested-by: Jarkko Sakkinen
Suggested-by: Dave Hansen
needs start a global level reclamation from the
root. Export misc_cg_root() for the SGX driver to access.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Tejun Heo
---
V6:
- Make commit messages more concis
callbacks for those events and allow resource providers to
register the callbacks per resource type as needed. This will be
utilized later by the EPC misc cgroup support implemented in the SGX
driver.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haita
From: Kristen Carlson Accardi
Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type
for the misc controller.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
---
V6:
- Split the original patch into
shold.
Later patches will reorganize the tracking and reclamation code in the
global reclaimer and implement per-cgroup tracking and reclaiming.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signe
Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
Reviewed-by: Jarkko Sakkinen
---
V6:
- removed introduction to unreclaimables in commit message.
V4:
- Removed unneeded comments for the spinlock and the non-reclaimables.
(Kai, Jarkko)
- Revised the
: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
---
V7:
- Split this out from the big patch, #10 in V6. (Dave, Kai)
---
arch/x86/kernel/cpu/sgx/main.c | 30
for an mm struct from enclave's mm_list.
Signed-off-by: Haitao Huang
Reported-by: Mikko Ylinen
---
V10:
- Pass mm struct instead of a boolean 'indirect'. (Dave, Jarkko)
V9:
- Reduce number of if statements. (Tim)
V8:
- Limit text paragraphs to 80 characters wide. (Jarkko)
---
a
thus
no per-cgroup reclamation is actually active at the moment. Per-cgroup
tracking and reclamation will be turned on in the end after all
necessary infrastructure is in place.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-dev
sgx_alloc_epc_pages().
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V11:
- Print error instead of WARN (Kai)
- Add check for need to queue an async reclamation before returning from
both work properly with all pages tracked in per-cgroup LRUs.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V11:
- Reword the comments for global reclamation for
laim().
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V10:
- Add comments for the new function. (Jarkko)
V7:
- Split this out from the big patch, #10 in V6. (Dave,
after all processes exit.
The script also includes a test with low mem_cg limit and LARGE sgx_epc
limit to verify that the RAM used for per-cgroup reclamation is charged
to a proper mem_cg. For this test, it turns off swapping before start,
and turns swapping back on afterwards.
Signed-off-by: Ha
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V8:
- Limit text width to 80 characters to be consistent.
V6:
- Remove mentioning of VMM specific behavior on handling SIGBUS
- Remove statement of forced reclamation, add statement to specify
ENOMEM returned when no
On Tue, 09 Apr 2024 10:34:06 -0500, Haitao Huang
wrote:
On Tue, 09 Apr 2024 04:03:22 -0500, Michal Koutný
wrote:
On Mon, Apr 08, 2024 at 11:23:21PM -0500, Haitao Huang
wrote:
It's always non-NULL based on testing.
It's hard for me to say definitely by reading the code
On Sun, 14 Apr 2024 10:01:03 -0500, Jarkko Sakkinen
wrote:
On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote:
To run selftests for EPC cgroup:
sudo ./run_epc_cg_selftests.sh
To watch misc cgroup 'current' changes during testing, run this in a
separat
On Sat, 13 Apr 2024 16:34:17 -0500, Jarkko Sakkinen
wrote:
On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote:
To run selftests for EPC cgroup:
sudo ./run_epc_cg_selftests.sh
To watch misc cgroup 'current' changes during testing, run this in a
separat
On Mon, 15 Apr 2024 14:08:44 -0500, Jarkko Sakkinen
wrote:
On Mon Apr 15, 2024 at 6:13 AM EEST, Haitao Huang wrote:
On Sun, 14 Apr 2024 10:01:03 -0500, Jarkko Sakkinen
wrote:
> On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote:
>> To run selftests for EPC cgroup:
&
nel.org/lkml/20240205210638.157741-1-haitao.hu...@linux.intel.com/T/
[15]v10:
https://lore.kernel.org/linux-sgx/20240328002229.30264-1-haitao.hu...@linux.intel.com/T/#t
[16]v11:
https://lore.kernel.org/lkml/20240410182558.41467-1-haitao.hu...@linux.intel.com/
Haitao Huang (3):
x86/sgx: Replace boolean p
Replace boolean parameters for 'reclaim' in the function
sgx_alloc_epc_page() and its callers with an enum.
Also opportunistically remove non-static declaration of
__sgx_alloc_epc_page() and a typo
Signed-off-by: Haitao Huang
Suggested-by: Jarkko Sakkinen
Suggested-by: Dave Hansen
R
sten Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Tejun Heo
Reviewed-by: Kai Huang
Tested-by: Jarkko Sakkinen
---
V12:
- Add comments in commit to clarify reason to pass in misc_cg, not
misc_res. (Kai)
- Remove unlikely (Kai)
needs start a global level reclamation from the
root. Export misc_cg_root() for the SGX driver to access.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Tejun Heo
Reviewed-by: Kai Huang
Tested-by: J
From: Kristen Carlson Accardi
Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type
for the misc controller.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Kai Huang
Tested-by: Jarkko
Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Kai Huang
Tested-by: Jarkko Sakkinen
---
V6:
- removed introduction to unreclaimables in commit message.
V4:
- Removed unneeded comments for the spinlock
: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Tested-by: Jarkko Sakkinen
---
V7:
- Split this out from the big patch, #10 in V6. (Dave, Kai)
---
arch/x86
shold.
Later patches will reorganize the tracking and reclamation code in the
global reclaimer and implement per-cgroup tracking and reclaiming.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-
sgx_alloc_epc_pages().
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Tested-by: Jarkko Sakkinen
---
V11:
- Print error instead of WARN (Kai)
- Add check for need to queue an async
for an mm struct from enclave's mm_list.
Signed-off-by: Haitao Huang
Reported-by: Mikko Ylinen
Tested-by: Mikko Ylinen
Tested-by: Jarkko Sakkinen
---
V10:
- Pass mm struct instead of a boolean 'indirect'. (Dave, Jarkko)
V9:
- Reduce number of if statements. (Tim)
V8:
- Limit tex
thus
no per-cgroup reclamation is actually active at the moment. Per-cgroup
tracking and reclamation will be turned on in the end after all
necessary infrastructure is in place.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-d
laim().
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Tested-by: Jarkko Sakkinen
---
V10:
- Add comments for the new function. (Jarkko)
V7:
- Split this out from the big p
both work properly with all pages tracked in per-cgroup LRUs.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Tested-by: Mikko Ylinen
Tested-by: Jarkko Sakkinen
---
V12
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
Tested-by: Mikko Ylinen
Tested-by: Jarkko Sakkinen
---
V8:
- Limit text width to 80 characters to be consistent.
V6:
- Remove mentioning of VMM specific behavior on handling SIGBUS
- Remove statement of forced reclamation
, it turns off swapping before start,
and turns swapping back on afterwards.
Add README to document how to run the tests.
Signed-off-by: Haitao Huang
---
V12:
- Integrate the scripts to the "run_tests" target. (Jarkko)
V11:
- Remove cgroups-tools dependency and make scripts ash
Missed adding the config file:
index ..e7f1db1d3eff
--- /dev/null
+++ b/tools/testing/selftests/sgx/config
@@ -0,0 +1,4 @@
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_MISC=y
+CONFIG_MEMCG=y
+CONFIG_X86_SGX=y
I'll send a fixup for this patch or another version of the series if more
changes a
On Tue, 16 Apr 2024 09:10:12 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 16, 2024 at 5:05 PM EEST, Jarkko Sakkinen wrote:
On Tue Apr 16, 2024 at 6:20 AM EEST, Haitao Huang wrote:
> With different cgroups, the script starts one or multiple concurrent
SGX
> selftests (test_sgx), each
On Tue, 16 Apr 2024 00:42:41 -0500, Huang, Kai wrote:
I'll send a fixup for this patch or another version of the series if
more
changes are needed.
Hi Haitao,
I don't like to say but in general I think you are sending too
frequently. The
last version was sent April, 11th (my time), so
On Tue, 16 Apr 2024 11:08:11 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 16, 2024 at 5:54 PM EEST, Haitao Huang wrote:
I did declare the configs in the config file but I missed it in my patch
as stated earlier. IIUC, that would not cause this error though.
Maybe I should exit with the skip
On Tue, 16 Apr 2024 17:04:21 -0500, Haitao Huang
wrote:
On Tue, 16 Apr 2024 11:08:11 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 16, 2024 at 5:54 PM EEST, Haitao Huang wrote:
I did declare the configs in the config file but I missed it in my
patch
as stated earlier. IIUC, that would not
On Mon, 15 Apr 2024 22:20:02 -0500, Haitao Huang
wrote:
diff --git a/arch/x86/kernel/cpu/sgx/Makefile
b/arch/x86/kernel/cpu/sgx/Makefile
index 9c1656779b2a..400baa7cfb69 100644
--- a/arch/x86/kernel/cpu/sgx/Makefile
+++ b/arch/x86/kernel/cpu/sgx/Makefile
@@ -1,6 +1,7 @@
obj-y
On Tue, 16 Apr 2024 09:07:33 -0500, Huang, Kai wrote:
On Mon, 2024-04-15 at 20:20 -0700, Haitao Huang wrote:
From: Kristen Carlson Accardi
The functions, sgx_{mark,unmark}_page_reclaimable(), manage the tracking
of reclaimable EPC pages: sgx_mark_page_reclaimable() adds a newly
allocated
On Tue, 16 Apr 2024 17:21:24 -0500, Haitao Huang
wrote:
On Tue, 16 Apr 2024 17:04:21 -0500, Haitao Huang
wrote:
On Tue, 16 Apr 2024 11:08:11 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 16, 2024 at 5:54 PM EEST, Haitao Huang wrote:
I did declare the configs in the config file but I
On Tue, 16 Apr 2024 08:22:06 -0500, Huang, Kai wrote:
On Mon, 2024-04-15 at 20:20 -0700, Haitao Huang wrote:
From: Kristen Carlson Accardi
SGX Enclave Page Cache (EPC) memory allocations are separate from normal
RAM allocations, and are managed solely by the SGX subsystem. The
existing
On Thu, 18 Apr 2024 18:29:53 -0500, Huang, Kai wrote:
--- /dev/null
+++ b/arch/x86/kernel/cpu/sgx/epc_cgroup.h
@@ -0,0 +1,72 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _SGX_EPC_CGROUP_H_
+#define _SGX_EPC_CGROUP_H_
+
+#include
I don't see why you need here. Also, ...
+#include
On Thu, 18 Apr 2024 20:32:14 -0500, Huang, Kai wrote:
On 16/04/2024 3:20 pm, Haitao Huang wrote:
From: Kristen Carlson Accardi
In cases EPC pages need be allocated during a page fault and the cgroup
usage is near its limit, an asynchronous reclamation needs be triggered
to avoid blocking
On Fri, 19 Apr 2024 17:44:59 -0500, Huang, Kai wrote:
On Fri, 2024-04-19 at 13:55 -0500, Haitao Huang wrote:
On Thu, 18 Apr 2024 20:32:14 -0500, Huang, Kai
wrote:
>
>
> On 16/04/2024 3:20 pm, Haitao Huang wrote:
> > From: Kristen Carlson Accardi
> > In cases EPC pa
On Sun, 21 Apr 2024 19:22:27 -0500, Huang, Kai wrote:
On Fri, 2024-04-19 at 20:14 -0500, Haitao Huang wrote:
> > I think we can add support for "sgx_cgroup=disabled" in future if
indeed
> > needed. But just for init failure, no?
> >
>
> It's not abo
Hi Jarkko
On Mon, 15 Apr 2024 14:08:44 -0500, Jarkko Sakkinen
wrote:
I did run the basic test by manually creating the cgroup so you could
add tested-by from my side to the other kernel patches expect this one
I've reviewed it enough rounds and given various code suggestions etc.
For me it
On Mon, 22 Apr 2024 17:16:34 -0500, Huang, Kai wrote:
On Mon, 2024-04-22 at 11:17 -0500, Haitao Huang wrote:
On Sun, 21 Apr 2024 19:22:27 -0500, Huang, Kai
wrote:
> On Fri, 2024-04-19 at 20:14 -0500, Haitao Huang wrote:
> > > > I think we can add support for "sgx
On Tue, 23 Apr 2024 09:19:53 -0500, Huang, Kai wrote:
On Tue, 2024-04-23 at 08:08 -0500, Haitao Huang wrote:
On Mon, 22 Apr 2024 17:16:34 -0500, Huang, Kai
wrote:
> On Mon, 2024-04-22 at 11:17 -0500, Haitao Huang wrote:
> > On Sun, 21 Apr 2024 19:22:27 -0500, Huang, Kai
On Wed, 17 Apr 2024 18:51:28 -0500, Huang, Kai wrote:
On 16/04/2024 3:20 pm, Haitao Huang wrote:
From: Kristen Carlson Accardi
Currently in the EPC page allocation, the kernel simply fails the
allocation when the current EPC cgroup fails to charge due to its usage
reaching limit. This is
On Tue, 23 Apr 2024 17:13:15 -0500, Huang, Kai wrote:
On Tue, 2024-04-23 at 10:30 -0500, Haitao Huang wrote:
> > It's a workaround because you use the capacity==0 but it does not
really
> > mean to disable the misc cgroup for specific resource IIUC.
>
> Please
Hi Jarkko
On Tue, 16 Apr 2024 11:08:11 -0500, Jarkko Sakkinen
wrote:
On Tue Apr 16, 2024 at 5:54 PM EEST, Haitao Huang wrote:
I did declare the configs in the config file but I missed it in my patch
as stated earlier. IIUC, that would not cause this error though.
Maybe I should exit with
On Mon, 29 Apr 2024 05:49:13 -0500, Huang, Kai wrote:
+/*
+ * Get the per-cgroup or global LRU list that tracks the given
reclaimable page.
+ */
static inline struct sgx_epc_lru_list *sgx_lru_list(struct
sgx_epc_page *epc_page)
{
+#ifdef CONFIG_CGROUP_MISC
+ /*
+* epc_pa
Hi Jarkko
On Sun, 28 Apr 2024 17:03:17 -0500, Jarkko Sakkinen
wrote:
On Fri Apr 26, 2024 at 5:28 PM EEST, Dave Hansen wrote:
On 4/16/24 07:15, Jarkko Sakkinen wrote:
> On Tue Apr 16, 2024 at 8:42 AM EEST, Huang, Kai wrote:
> Yes, exactly. I'd take one week break and cycle the kselftest par
On Mon, 29 Apr 2024 11:43:05 -0500, Jarkko Sakkinen
wrote:
On Mon Apr 29, 2024 at 7:18 PM EEST, Haitao Huang wrote:
Hi Jarkko
On Sun, 28 Apr 2024 17:03:17 -0500, Jarkko Sakkinen
wrote:
> On Fri Apr 26, 2024 at 5:28 PM EEST, Dave Hansen wrote:
>> On 4/16/24 07:15, Jarkko Sakki
On Mon, 29 Apr 2024 17:18:05 -0500, Huang, Kai wrote:
/*
@@ -42,7 +63,8 @@ static inline struct sgx_epc_lru_list
*sgx_lru_list(struct sgx_epc_page *epc_pag
*/
static inline bool sgx_can_reclaim(void)
{
-return !list_empty(&sgx_global_lru.reclaimable);
+return !sgx_cgroup_lru_e
Replace boolean parameters for 'reclaim' in the function
sgx_alloc_epc_page() and its callers with an enum.
Also opportunistically remove non-static declaration of
__sgx_alloc_epc_page() and a typo
Signed-off-by: Haitao Huang
Suggested-by: Jarkko Sakkinen
Suggested-by: Dave Hansen
R
el.org/linux-sgx/20240328002229.30264-1-haitao.hu...@linux.intel.com/T/#t
[16]v11:
https://lore.kernel.org/lkml/20240410182558.41467-1-haitao.hu...@linux.intel.com/
[17]v12:
https://lore.kernel.org/lkml/20240416032011.58578-1-haitao.hu...@linux.intel.com/
Haitao Huang (3):
x86/sgx: Replace boolean parameter
sten Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Tejun Heo
Reviewed-by: Kai Huang
Tested-by: Jarkko Sakkinen
---
V12:
- Add comments in commit to clarify reason to pass in misc_cg, not
misc_res. (Kai)
- Remove unlikely (Kai)
needs start a global level reclamation from the
root. Export misc_cg_root() for the SGX driver to access.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Tejun Heo
Reviewed-by: Kai Huang
Tested-by: J
From: Kristen Carlson Accardi
Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type
for the misc controller.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Kai Huang
Tested-by: Jarkko
shold.
Later patches will reorganize the tracking and reclamation code in the
global reclaimer and implement per-cgroup tracking and reclaiming.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-of
for an mm struct from enclave's mm_list.
Signed-off-by: Haitao Huang
Reported-by: Mikko Ylinen
Reviewed-by: Kai Huang
Tested-by: Mikko Ylinen
Tested-by: Jarkko Sakkinen
---
V10:
- Pass mm struct instead of a boolean 'indirect'. (Dave, Jarkko)
V9:
- Reduce number of if sta
Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
Reviewed-by: Jarkko Sakkinen
Reviewed-by: Kai Huang
Tested-by: Jarkko Sakkinen
---
V6:
- removed introduction to unreclaimables in commit message.
V4:
- Removed unneeded comments for the spinlock
ing to
the global LRU directly.
This allows EPC page being able to be tracked in "per-cgroup" LRU when
that becomes ready.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haita
thus
no per-cgroup reclamation is actually active at the moment. Per-cgroup
tracking and reclamation will be turned on in the end after all
necessary infrastructure is in place.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-
Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Tested-by: Jarkko Sakkinen
---
V13:
- Revert to BUG_ON() in case of workq allocation failure in init and
only alloc if misc is enabled.
V11:
- Print error instead of WARN (Kai)
- Add check
s to
sgx_can_reclaim_global().
Rename sgx_should_reclaim() to sgx_should_reclaim_global() as it is used
to check if a global reclamation should be performed.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao H
, it turns off swapping before start,
and turns swapping back on afterwards.
Add README to document how to run the tests.
Signed-off-by: Haitao Huang
---
V13:
- More improvement on handling error cases and style fixes.
- Add settings file for custom timeout
V12:
- Integrate the scripts to the
reclamation
both work properly with all pages tracked in per-cgroup LRUs.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Tested-by: Mikko Ylinen
Tested-by: Jarkko Sakkinen
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
Reviewed-by: Bagas Sanjaya
Acked-by: Kai Huang
Tested-by: Mikko Ylinen
Tested-by: Jarkko Sakkinen
---
V8:
- Limit text width to 80 characters to be consistent.
V6:
- Remove mentioning of VMM specific behavior on handling
Hi Kai
Sorry there seems to be some delay in receiving my emails.
On Thu, 02 May 2024 18:23:06 -0500, Huang, Kai wrote:
On 1/05/2024 7:51 am, Haitao Huang wrote:
From: Kristen Carlson Accardi
For the global reclaimer to determine if any page available for
reclamation at the global level
On Mon, 06 May 2024 19:10:42 -0500, Huang, Kai wrote:
On 1/05/2024 7:51 am, Haitao Huang wrote:
static void sgx_reclaim_pages_global(struct mm_struct *charge_mm)
{
- sgx_reclaim_pages(&sgx_global_lru, charge_mm);
+ if (IS_ENABLED(CONFIG_CGROUP_
On Wed, 15 May 2024 01:55:21 -0500, Bojun Zhu
wrote:
EDMM's ioctl()s support batch operations, which may be
time-consuming. Try to explicitly give up the CPU as the prefix
operation at the every begin of "for loop" in
sgx_enclave_{ modify_types | restrict_permissions | remove_pages}
to give o
ave_ptes().
*/
+ entry->desc |= SGX_ENCL_PAGE_BEING_REMOVED;
mutex_unlock(&encl->lock);
sgx_zap_enclave_ptes(encl, addr);
Reviewed-by: Haitao Huang
t_t sgx_encl_eaug_page(struct
vm_area_struct *vma,
err_out_shrink:
sgx_encl_shrink(encl, va_page);
err_out_epc:
- sgx_encl_free_epc_page(epc_page);
+ sgx_free_epc_page(epc_page);
err_out_unlock:
mutex_unlock(&encl->lock);
kfree(encl_page);
Reviewed-by: Haitao Huang
On Wed, 15 May 2024 16:55:59 -0500, Haitao Huang
wrote:
On Wed, 15 May 2024 01:55:21 -0500, Bojun Zhu
wrote:
EDMM's ioctl()s support batch operations, which may be
time-consuming. Try to explicitly give up the CPU as the prefix
operation at the every begin of "for loop"
101 - 200 of 393 matches
Mail list logo