Venue | Category |
---|---|
SysTEX'18 | SGX-Technique |
Switchless Calls Made Practical in Intel SGX1. SummaryMotivation of this paperSwitchless callsImplementation and Evaluation2. Strength (Contributions of the paper)3. Weakness (Limitations of the paper)4. Some Insights (Future work)
Motivation
One primary performance overhead is enclave switches
, which are expensive and can be triggered frequently by cross-enclave function calls.
It argues this technique is questionable in terms of efficiency
Existing work
Switchless calls: caller thread send the request of ECalls/OCalls into shared, untrusted buffers, from which the requests are received and processed asynchronously by worker threads.
is questionable in face of diverse and dynamic workloads encountered by real-world applications
Main idea:
trade as few as extra CPU cores as possible for as many reduced enclave switches as possible
determine on what conditions can switchless calls improve the performance efficiently
insights:
short and called frequently
Performance model
assume the implementation of switchless calls adopts the busy-wait
approach
model
the time spent inside the enclave
the time spent outside the enclave
the time to do an enclave switch
insights:
Efficiency-based worker scheduling algorithm
strike a good balance between performance speedup and power conservation
determine, at any point in time, the optimal number of workers so that the performance speedup of the callers is maximized while the wasted CPU cycles of the worker are minimized
worker efficiency
Algorithm:
maximizing the number of worker threads under the constraints of an upper bound on the number of worker threads and a lower bound on the average worker efficiency.
adjust the number of running worker threads by sleeping or waking up threads
current average worker efficiency < the expected worker efficiency
current average worker efficiency > the expected worker efficiency
Implementation (in Intel SGX SDK)
adopt busy-wait
switchless approach
maintain a fixed size thread pool for workers
Easy to use: label in EDL file
Customizable worker management
Evaluation
Static workloads
Dynamic workloads
the first work gives an in-depth performance analysis of switchless calls
propose a self-adaptive worker scheduling algorithm to automatically determine the number of workers
SGX background