diff options
| author | Shengming Hu <hu.shengming@zte.com.cn> | 2026-01-29 17:38:14 +0300 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-03-25 00:38:25 +0300 |
| commit | 7e74dd031620549174eb287649aa12970ef56589 (patch) | |
| tree | 5681551ba888976350032642ab1076e5865dc731 /include/linux/string.h | |
| parent | 396f57b5720024638dbb503f6a4abd988a49d815 (diff) | |
| download | linux-7e74dd031620549174eb287649aa12970ef56589.tar.xz | |
mm/page_alloc: avoid overcounting bulk alloc in watermark check
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>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
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: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions
