-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn off EPC paging #94
Comments
The EPC area contains both your data (the buffer but also others such as stack, global variables your binary code...). When the size of your "working set" passes the 96MB limit (and not 128MB since 32MB are reserved), then the sub system (the driver) is starting to swap. This is not a "nice to have" feature but a necessary feature in order to have your running environment up and running. If swapping was disabled, either the allocation or your buffer access would fail and your program would crash / exit much before. |
Got it. I did notice the drop between 90-100MB - the 32 MB reserved explains it. Thank you for the clear explanation. |
This is almost true:
|
Ok, so the EPC pages are managed by the SGX driver, not the Linux memory management subsystem. And modifying the driver code is not trivial, and there are no settings I can change anywhere to prevent paging out of the EPC pages? |
At your own risk... |
Hi, I'm working with the original question asker. In our case, we're doing some performance testing and want to make sure that our tests are not triggering swapping without us realizing it. The thought with turning it off was that we'd rather have the enclave crash due to running out of memory. (Because then we know we screwed up and should lower our memory usage.) Thanks for your feedback and help! |
Hello,
I am running a program assigning a buffer inside the enclave using malloc, at runtime. I then perform some read/write operations on the buffer. I can see performance slow down and then drop once the EPC limit is reached, with a large buffer. I understand that the EPC size is set to 128MB maximum.
Is there a way to turn off EPC paging in SGX, to ensure the active pages are not swapped out?
I was told there was no way to turn off the swap feature without changing the driver code. I am looking at sgx_page_cache.c, at a function called "sgx_swap_pages" - what must I change to turn off the swap feature?
If I stick to sizes small enough that I know will not trigger paging, will I be able to load the enclave, if I turn off swap?
Thank you
The text was updated successfully, but these errors were encountered: