From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796113683; b=wWu7gKFn01KlbTxaga66m/gsxABuPjTiH8FNCC+mnKPAF4moc1cu4hWaoSdqFKFDU5LT eYzO17htBwY0fIyyB4gw/CSv0YoKmsROXxz1zLO3+7dl0ORonsKZS3i42HkhmGO/bSMRg hPrk0Vjv3sz3CXbHLKS5YXdMaNAghaAxVKSxrj3ncLX6X3hFTEN+I0/rQx/zF+Tgpz5fj AbOSRkLe17JXeOWmhsOoSc68tUiq+uZN8RLUKG8GqHmb1x6g8KbNbp+fWCw87d6G4X3ok oSYiI1Ps0vWNJDWqMlC48qjLwT6TJ7r3LuHeFL7hfdLfNY743G2ts79G4xtnJ8LHDzw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796113683; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=WhAqq1ObFO98yiJapwRrp6omOoPldhrRtZX8NaEnmIQ=; b=DvRoRbn7GNJ0Rk4kQN+5MpI9y1v02+iHvs8I9zieJelrWIzsosDCmSz2trQ4qXrRI99s 6Ai43m4HcV/7R5MzghMp1leURVzdxOlxqHonTxoXeSdlV2Y/z8IIVL2B/B5Z1viK2/bOG 3fk70k0jk5wrObkR97V6hMLu2ZbbKYlbKHijQTRG4Oxlq+FfoT7ueg8rRUwVyGtZXPR7+ dyXlibjoNkxIt0IbUpRQE5Ab3wN+k4kaf3frv79Qrcvpe0QNDzIP4t925hgx2bAlgR2VN YU2b+BbFePQC/kn32KIxUf7q4M+5Cz5T+9F7/Em0n6w48inXjGkyb3Z7fsLtNJY4KsA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=HboRF6oi; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB5F6606A31A; Tue, 1 Dec 2026 08:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=HboRF6oi Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47CCE1F0089A; Tue, 1 Dec 2026 08:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796113683; bh=WhAqq1ObFO98yiJapwRrp6omOoPldhrRtZX8NaEnmIQ=; h=Date:To:From:In-Reply-To:References:Subject; b=HboRF6oiiFrAViTfC7aBusAs8Z5VCl/oqU6heWRd2UtY0PGNuIKjgWD/2A5k28WMM Xgfdp3oSHdrH2F9Uq5qqwCVvHAjcZGZE3gOuhImWgike2E+G/2m/+OWiCavIOOgOnw zB+5WzFYdM0KDuV57OkkVKKoKooYiciDts/97uw0= Date: Tue, 01 Dec 2026 00:28:02 -0800 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 From: Andrew Morton In-Reply-To: <20261130064652.184634-1-zelin.deng@linux.alibaba.com> References: <20261130064652.184634-1-zelin.deng@linux.alibaba.com> Subject: + mm-vmscan-fix-inverted-free-page-check-in-allow_direct_reclaim.patch added to mm-new branch Message-Id: <20261201082803.47CCE1F0089A@smtp.kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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 Signed-off-by: Andrew Morton Reviewed-by: Baolin Wang Cc: liuqiqi Cc: Johannes Weiner Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Kairui Song Cc: Barry Song Cc: Axel Rasmussen Cc: Yuanchu Xie Cc: Wei Xu Cc: Baoquan He Cc: 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