Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Luiz Capitulino <luizcap@redhat.com>,
	Ketan <ketan.kishore@oss.qualcomm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <jackmanb@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
	kernel@oss.qualcomm.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: page_ext: validate section in for_each_page_ext iterator
Date: Fri, 19 Jun 2026 15:45:31 +0200	[thread overview]
Message-ID: <4621037e-d051-4db1-bb58-ffe8c0afa3de@kernel.org> (raw)
In-Reply-To: <ajVGQg0hJCUThz5Q@casper.infradead.org>

On 6/19/26 15:38, Matthew Wilcox wrote:
> On Fri, Jun 19, 2026 at 10:00:59AM +0200, David Hildenbrand (Arm) wrote:
>> Likely we should just handle that in the iterator, looking up page-ext for something
>> that doesn't exist is weird.
> 
> Yes, but I prefer to pass 'max' to the _next step explicitly, rather
> than put it in the iterator struct.  Untested patch attached.

Yeah, no strong opinion, same fix idea.

> 
> The other way to do it is s/index/remaining/ and count it down rather
> than upwards.  But that assumes none of the iterator users look at
> iter->index, and I don't have the patience to check that.
> 
> I find it weird that somebody botheresd to add kernel-doc for
> page_ext_iter_begin/next.  They're internal implementation and really
> shouldn't have public documentation.

Yeah, Luiz was just very thorough :)


-- 
Cheers,

David


  reply	other threads:[~2026-06-19 13:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 15:09 [PATCH] mm: page_ext: validate section in for_each_page_ext iterator Ketan
2026-06-17 15:52 ` Zi Yan
2026-06-18  9:04 ` David Hildenbrand (Arm)
2026-06-19  2:38   ` Luiz Capitulino
2026-06-19  8:00     ` David Hildenbrand (Arm)
2026-06-19 13:38       ` Matthew Wilcox
2026-06-19 13:45         ` David Hildenbrand (Arm) [this message]
2026-06-19 20:44         ` Ketan Kishore
2026-06-19 20:36       ` Ketan Kishore
2026-06-19 20:31     ` Ketan Kishore

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=4621037e-d051-4db1-bb58-ffe8c0afa3de@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=kernel@oss.qualcomm.com \
    --cc=ketan.kishore@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luizcap@redhat.com \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=willy@infradead.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