Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,yuanchu@google.com,weixugc@google.com,
	stable@vger.kernel.org,shakeel.butt@linux.dev,qi.zheng@linux.dev,
	mhocko@kernel.org,liuqiqi@kylinos.cn,kasong@tencent.com,hannes@cmpxchg.org,
	baoquan.he@linux.dev,baolin.wang@linux.alibaba.com,baohua@kernel.org,
	axelrasmussen@google.com,zelin.deng@linux.alibaba.com,
	akpm@linux-foundation.org
Subject: + mm-vmscan-fix-inverted-free-page-check-in-allow_direct_reclaim.patch added to mm-new branch
Date: Tue, 01 Dec 2026 00:28:02 -0800	[thread overview]
Message-ID: <20261201082803.47CCE1F0089A@smtp.kernel.org> (raw)
In-Reply-To: <20261130064652.184634-1-zelin.deng@linux.alibaba.com>


The patch titled
     Subject: mm: vmscan: fix inverted free page check in allow_direct_reclaim()
has been added to the -mm mm-new branch.  Its filename is
     mm-vmscan-fix-inverted-free-page-check-in-allow_direct_reclaim.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmscan-fix-inverted-free-page-check-in-allow_direct_reclaim.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

The mm-new branch of mm.git is not included in linux-next

If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Zelin Deng <zelin.deng@linux.alibaba.com>
Subject: mm: vmscan: fix inverted free page check in allow_direct_reclaim()
Date: Mon, 30 Nov 2026 14:46:52 +0800

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().

Link: https://patch.msgid.link/20261130064652.184634-1-zelin.deng@linux.alibaba.com
Fixes: 4bd22a7ae574 ("mm: fix duplicate accounting of free pages in should_reclaim_retry()")
Signed-off-by: Zelin Deng <zelin.deng@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: liuqiqi <liuqiqi@kylinos.cn>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Kairui Song <kasong@tencent.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: <stable@vger.kernel.org>

 mm/vmscan.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/vmscan.c~mm-vmscan-fix-inverted-free-page-check-in-allow_direct_reclaim
+++ a/mm/vmscan.c
@@ -6940,7 +6940,8 @@ static bool allow_direct_reclaim(pg_data
 		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);
_

Patches currently in -mm which might be from zelin.deng@linux.alibaba.com are

mm-vmscan-fix-inverted-free-page-check-in-allow_direct_reclaim.patch


      parent reply	other threads:[~2026-12-01  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  6:46 [PATCH] mm: vmscan: fix inverted free page check in allow_direct_reclaim() Zelin Deng
2026-12-01  7:31 ` Baolin Wang
2026-12-01  8:28 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201082803.47CCE1F0089A@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=baoquan.he@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=liuqiqi@kylinos.cn \
    --cc=mhocko@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=qi.zheng@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    --cc=zelin.deng@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox