Commit 4bd22a7ae574 ("mm: fix duplicate accounting of free pages in should_reclaim_retry()") removed the free-page fallback from zone_reclaimable_pages() and added an explicit check in allow_direct_reclaim(). Before that change, allow_direct_reclaim() skipped a zone only when it had neither reclaimable nor free pages. The new check was inverted: it skips a zone when it has no reclaimable pages but does have free pages. It also keeps a zone that has neither, adding its watermark without adding any free pages. As a result, allow_direct_reclaim() can keep returning false and leave direct reclaimers throttled even though free pages are available. Negate the free-page test to restore the previous behavior while keeping free pages out of zone_reclaimable_pages(). Fixes: 4bd22a7ae574 ("mm: fix duplicate accounting of free pages in should_reclaim_retry()") Cc: Baolin Wang Cc: stable@vger.kernel.org Signed-off-by: Zelin Deng --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 851d813d0937..71f91a8a003b 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -6858,7 +6858,8 @@ static bool allow_direct_reclaim(pg_data_t *pgdat) return true; for_each_managed_zone_pgdat(zone, pgdat, i, ZONE_NORMAL) { - if (!zone_reclaimable_pages(zone) && zone_page_state_snapshot(zone, NR_FREE_PAGES)) + if (!zone_reclaimable_pages(zone) && + !zone_page_state_snapshot(zone, NR_FREE_PAGES)) continue; pfmemalloc_reserve += min_wmark_pages(zone); base-commit: 890dc639d8a33e674caa7ea9993dbd2416660447 -- 2.43.7