From: "Zi Yan" <ziy@nvidia.com>
To: "Petr Tesarik" <ptesarik@suse.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"David Hildenbrand" <david@kernel.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Mike Rapoport" <rppt@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Michal Hocko" <mhocko@suse.com>, <linux-mm@kvack.org>
Cc: "Brendan Jackman" <jackmanb@google.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] mm: let node_reclaim() return the number of pages reclaimed
Date: Mon, 13 Jul 2026 15:31:32 -0400 [thread overview]
Message-ID: <DJXOZ1TZN3XW.21PDLRBVIED2N@nvidia.com> (raw)
In-Reply-To: <20260710152320.2024283-1-ptesarik@suse.com>
On Fri Jul 10, 2026 at 11:23 AM EDT, Petr Tesarik wrote:
> There is only one caller, get_page_from_freelist(), and it does not make
> any use of the reason for skipping the reclaim, nor does it make any
> distinction between a full and partially successful reclaim.
>
> Therefore, node_reclaim() can simply return the number of pages that have
> been reclaimed, same as __node_reclaim(), and the NODE_RECLAIM_xxx macros
> can be removed.
>
> There is one small change of behavior when __node_reclaim() was attempted
> but returned zero. The allocation now skips the zone immediately; before
> this patch, the zone watermarks were checked first. I believe it was an
> oversight rather than intention, because the chances that zone watermark is
> OK after __node_reclaim() did not reclaim any pages are very close to zero.
>
> Originally, I was looking for occurences of NODE_RECLAIM_SOME and
> NODE_RECLAIM_SUCCESS, but I couldn't find any. That's because they are
> typecast from the result of a relational operator. This seemed a bit
> fragile, so I dug a bit deeper and came up with this proposed cleanup.
>
> Signed-off-by: Petr Tesarik <ptesarik@suse.com>
>
> --
>
> Changes from v2:
> - remove the enum and return the number of pages reclaimed
>
> Changes from v1:
> - use an enum instead of a bool
> ---
> mm/internal.h | 9 +++++----
> mm/page_alloc.c | 19 ++++---------------
> mm/vmscan.c | 16 ++++++++--------
> 3 files changed, 17 insertions(+), 27 deletions(-)
>
With the macro removed, feel free to add
Reviewed-by: Zi Yan <ziy@nvidia.com>
--
Best Regards,
Yan, Zi
prev parent reply other threads:[~2026-07-13 19:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 15:23 [PATCH v3 1/1] mm: let node_reclaim() return the number of pages reclaimed Petr Tesarik
2026-07-10 23:27 ` Andrew Morton
2026-07-13 11:04 ` Johannes Weiner
2026-07-13 12:55 ` Petr Tesarik
2026-07-13 14:27 ` Vlastimil Babka (SUSE)
2026-07-13 19:31 ` Zi Yan [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=DJXOZ1TZN3XW.21PDLRBVIED2N@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=ptesarik@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/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