@@ -291,7 +291,7 @@ static void sgx_reclaimer_write(struct sgx_epc_page *epc_page,
* problematic as it would increase the lock contention too much, which would
* halt forward progress.
*/
-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_epc_page *epc_page, *tmp;
@@ -326,7 +326,7 @@ static void __sgx_reclaim_pages(int nr_to_scan)
spin_unlock(&sgx_global_lru.lock);
if (list_empty(&iso))
- return;
+ return 0;
i = 0;
list_for_each_entry_safe(epc_page, tmp, &iso, list) {
@@ -371,12 +371,16 @@ static void __sgx_reclaim_pages(int nr_to_scan)
sgx_free_epc_page(epc_page);
}
+ return i;
}
-static void sgx_reclaim_pages(int nr_to_scan)
+static int sgx_reclaim_pages(int nr_to_scan)
{
- __sgx_reclaim_pages(nr_to_scan);
+ int ret;
+
+ ret = __sgx_reclaim_pages(nr_to_scan);
cond_resched();
+ return ret;
}
static bool sgx_should_reclaim(unsigned long watermark)