@@ -290,8 +290,10 @@ static void sgx_reclaimer_write(struct sgx_epc_page *epc_page,
* + EWB) but not sufficiently. Reclaiming one page at a time would also be
* problematic as it would increase the lock contention too much, which would
* halt forward progress.
+ *
+ * Return: number of EPC pages reclaimed
*/
-static void sgx_reclaim_pages(int nr_to_scan)
+static int sgx_reclaim_pages(int nr_to_scan)
{
struct sgx_backing backing[SGX_MAX_NR_TO_RECLAIM];
struct sgx_encl_page *encl_page;
@@ -373,6 +375,7 @@ static void sgx_reclaim_pages(int nr_to_scan)
}
out:
cond_resched();
+ return i;
}
static bool sgx_should_reclaim(unsigned long watermark)