mystikos icon indicating copy to clipboard operation
mystikos copied to clipboard

perf: optimize kstack size

Open paulcallen opened this issue 3 years ago • 2 comments

not all kernel stacks need large stacks. we can determine this from the syscall ID... for instance verify report is very deep, but a number of others like getpid are very small. we can have maybe 2 different stack sizes and if a syscall needs a large stack it gets 64k, otherwise we can probably use as small as 16k or less.

paulcallen avatar Nov 24 '21 17:11 paulcallen

@paulcallen Is it a good idea to measure the memory requirement for each syscall statically and then map each one to a different stack size (2 or more)?

isil-oz avatar Aug 09 '22 12:08 isil-oz

call stacks that dont jump out of the enclave can be significantly smaller. When running on coffeelake machines which have a small memory availability having all stacks be the larger size can really affect performance. This is especially true with languages like .NET.

paulcallen avatar Aug 10 '22 22:08 paulcallen