* + mm-page_alloc-avoid-overcounting-bulk-alloc-in-watermark-check.patch added to mm-new branch
@ 2026-01-30 7:01 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-01-30 7:01 UTC (permalink / raw)
To: mm-commits, ziy, vbabka, surenb, mhocko, jackmanb, hannes,
hu.shengming, akpm
The patch titled
Subject: mm/page_alloc: avoid overcounting bulk alloc in watermark check
has been added to the -mm mm-new branch. Its filename is
mm-page_alloc-avoid-overcounting-bulk-alloc-in-watermark-check.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-avoid-overcounting-bulk-alloc-in-watermark-check.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
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: Shengming Hu <hu.shengming@zte.com.cn>
Subject: mm/page_alloc: avoid overcounting bulk alloc in watermark check
Date: Thu, 29 Jan 2026 22:38:14 +0800
alloc_pages_bulk_noprof() only fills NULL slots and already tracks how
many entries are pre-populated via nr_populated.
The fast watermark check was adding nr_pages unconditionally, which can
overestimate the demand. Use (nr_pages - nr_populated) instead, as an
upper bound on the remaining pages this call can still allocate without
scanning the whole array.
Link: https://lkml.kernel.org/r/tencent_F36C5B5FB4DED98C79D9BDEE1210CD338C06@qq.com
Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/page_alloc.c~mm-page_alloc-avoid-overcounting-bulk-alloc-in-watermark-check
+++ a/mm/page_alloc.c
@@ -5125,7 +5125,7 @@ unsigned long alloc_pages_bulk_noprof(gf
cond_accept_memory(zone, 0, alloc_flags);
retry_this_zone:
- mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK) + nr_pages;
+ mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK) + nr_pages - nr_populated;
if (zone_watermark_fast(zone, 0, mark,
zonelist_zone_idx(ac.preferred_zoneref),
alloc_flags, gfp)) {
_
Patches currently in -mm which might be from hu.shengming@zte.com.cn are
mm-page_alloc-avoid-overcounting-bulk-alloc-in-watermark-check.patch
watchdog-softlockup-fix-sample-ring-index-wrap-in-need_counting_irqs.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-30 7:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-30 7:01 + mm-page_alloc-avoid-overcounting-bulk-alloc-in-watermark-check.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.