On Mon, Aug 26, 2019 at 09:33:23AM +0300, Jarkko Sakkinen wrote: > Convert sgx_reclaim_pages() to sgx_reclaim_page(), which reclaims only a > signle page and returns it back to the caller instead of freeing it. > > A simpler flow will allow also simplify sgx_alloc_page() flow and make it > constant time. With this change it is easer to pin backing storage before Nit: it doesn't run in constant time, its upper bound is simply lower. > the pages are blocked, which stabilizes the EBLOCK/EWB/ETRACK flow: only an > EPCM conflict could cause a EWB to fail. > > Because sgx_alloc_page() operations run in parallel on different threads > ETRACK's will still group multiple EBLOCK operations. ksgxswapd can be > improved in future with multi-threading (e.g.a work queue). I won't be able to give this a thorough review for a few days due to other tasks. We should definitely do some rudimentary performance testing given the potential impact.