On 1 Dec 2022 15:39:23 -0700 Yu Zhao <yuzhao@xxxxxxxxxx> > Among the flags in scan_control: > 1. sc->may_swap, which indicates swap constraint due to memsw.max, is > supported as usual. > 2. sc->proactive, which indicates reclaim by memory.reclaim, may not > opportunistically skip the aging path, since it is considered less > latency sensitive. > 3. !(sc->gfp_mask & __GFP_IO), which indicates IO constraint, > prioritizes file LRU, since clean file folios are more likely to > exist. > 4. sc->may_writepage and sc->may_unmap, which indicates opportunistic > reclaim, are rejected, since unmapped clean folios are already > prioritized. Scanning for more of them is likely futile and can > cause high reclaim latency when there is a large number of memcgs. Nit, just because of gfp without __GFP_IO set does not mean there are likely more clean page caches, though prioritized, on the local numa node than a remote one, and vice verse. Hillf /** * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope. * * This functions marks the beginning of the GFP_NOIO allocation scope. * All further allocations will implicitly drop __GFP_IO flag and so * they are safe for the IO critical section from the allocation recursion * point of view. Use memalloc_noio_restore to end the scope with flags * returned by this function. * * This function is safe to be used from any context. */