From: Petr Tesarik <ptesarik@suse.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: 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, Brendan Jackman <jackmanb@google.com>,
Zi Yan <ziy@nvidia.com>,
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 14:55:45 +0200 [thread overview]
Message-ID: <20260713145545.1ff1136b@mordecai> (raw)
In-Reply-To: <20260713110443.GD276793@cmpxchg.org>
V Mon, 13 Jul 2026 07:04:43 -0400
Johannes Weiner <hannes@cmpxchg.org> napsáno:
> On Fri, Jul 10, 2026 at 05:23:20PM +0200, 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>
>
> Looks good to me, and agree with the minor change in behavior being
> acceptable. With the macros actually removed,
Uh-oh, I missed that hunk when rebasing, and of course, there's no
compiler warning about unused macros. :-(
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Thank you. Shall I resubmit once more to include the hunk that removes
the macros from mm/internal.h?
Petr T
next prev parent reply other threads:[~2026-07-13 12:55 UTC|newest]
Thread overview: 5+ 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 [this message]
2026-07-13 19:31 ` Zi Yan
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=20260713145545.1ff1136b@mordecai \
--to=ptesarik@suse.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=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.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