All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Tesarik <ptesarik@suse.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.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>,
	Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] mm: reduce NODE_RECLAIM_xxx and change to enum
Date: Fri, 12 Jun 2026 17:10:36 +0200	[thread overview]
Message-ID: <20260612171036.0bb6a2ed@mordecai> (raw)
In-Reply-To: <fb652b0a-9c3e-48bf-a301-16d37f212aca@kernel.org>

On Fri, 12 Jun 2026 16:57:08 +0200
"David Hildenbrand (Arm)" <david@kernel.org> wrote:

> On 6/12/26 10:50, Petr Tesarik wrote:
> > Change node_reclaim() to return an enum indicating whether any
> > pages have been reclaimed, because that's all the information
> > needed by the only caller, get_page_from_freelist().
> > 
> > This leads to the following translation of the old macro
> > identifiers to the new enum values:
> > 
> > - NODE_RECLAIM_NOSCAN  -> NODE_RECLAIM_NONE
> > - NODE_RECLAIM_FULL    -> NODE_RECLAIM_NONE
> > - NODE_RECLAIM_SOME    -> NODE_RECLAIM_SUCCESS
> > - NODE_RECLAIM_SUCCESS -> NODE_RECLAIM_SUCCESS  
> 
> Why not simply return the number of reclaimed pages (0 vs > 0)? I agree that a
> bool is not good.
> 
> Or if that is not good enough (for some reason) return 0 (success) vs. -ENOENT?

I don't have a strong opinion, except I hate the current code. ;-)

If we can agree that get_page_from_freelist() need not recheck with
zone_watermark_ok() after __node_reclaim() returns zero, then I believe
the cleanest option is to return the number of pages (zero if reclaim
was not even attempted).

Petr T


  reply	other threads:[~2026-06-12 15:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12  8:50 [PATCH v2 1/1] mm: reduce NODE_RECLAIM_xxx and change to enum Petr Tesarik
2026-06-12 10:10 ` Brendan Jackman
2026-06-12 11:31   ` Petr Tesarik
2026-06-12 14:28     ` Brendan Jackman
2026-06-12 15:01       ` Zi Yan
2026-06-12 15:10         ` Brendan Jackman
2026-06-12 15:17           ` Zi Yan
2026-06-12 14:57 ` David Hildenbrand (Arm)
2026-06-12 15:10   ` Petr Tesarik [this message]
2026-06-12 14:57 ` 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=20260612171036.0bb6a2ed@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 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.