On 2/5/24 13:06, Haitao Huang wrote: > @@ -414,7 +416,7 @@ static void sgx_reclaim_pages_global(void) > void sgx_reclaim_direct(void) > { > if (sgx_should_reclaim(SGX_NR_LOW_PAGES)) > - sgx_reclaim_pages_global(); > + sgx_reclaim_pages_global(false); > } > > static int ksgxd(void *p) > @@ -437,7 +439,7 @@ static int ksgxd(void *p) > sgx_should_reclaim(SGX_NR_HIGH_PAGES)); > > if (sgx_should_reclaim(SGX_NR_HIGH_PAGES)) > - sgx_reclaim_pages_global(); > + sgx_reclaim_pages_global(true); > > cond_resched(); > } First, I'm never a fan of random true/false or 0/1 arguments to functions like this. You end up having to go look at the called function to make any sense of it. You can either do an enum, or some construct like this: if (sgx_should_reclaim(SGX_NR_HIGH_PAGES)) { bool indirect = true; sgx_reclaim_pages_global(indirect); } Yeah, it takes a few more lines but it saves you having to comment the thing. Does this 'indirect' change any behavior other than whether it does a search for an mm to find a place to charge the backing storage? Instead of passing a flag around, why not just pass the mm? This refactoring out of 'indirect' or passing the mm around really wants to be in its own patch anyway.