From: Kiryl Shutsemau <kas@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: Breno Leitao <leitao@debian.org>,
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>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Baoquan He <baoquan.he@linux.dev>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
Miaohe Lin <linmiaohe@huawei.com>,
Naoya Horiguchi <nao.horiguchi@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kexec@lists.infradead.org, rmikey@meta.com, riel@surriel.com,
kernel-team@meta.com
Subject: Re: [PATCH v5] kexec: keep the next kernel off hardware-poisoned pages
Date: Tue, 11 Aug 2026 15:21:46 +0100 [thread overview]
Message-ID: <ansuaOyItxGTBlTl@thinkstation> (raw)
In-Reply-To: <anskyrEVUlnTVEgF@kernel.org>
On Tue, Aug 11, 2026 at 04:34:02PM +0300, Mike Rapoport wrote:
> On Tue, Aug 11, 2026 at 04:17:41AM -0700, Breno Leitao wrote:
> > > > + for (pfn = PHYS_PFN(start); pfn <= end_pfn; pfn++) {
> > > > +
> > > > + cond_resched();
> > >
> > > cond_resched() for every pfn is too much, isn't it?
> >
> > It is what the other pfn walkers do: the kpageflags read loop in
> > fs/proc/page.c and read_page_owner() in mm/page_owner.c both call it
> > once per pfn.
>
> I think it depends on the pfn walker, some of them cond_resched() once per
> "block"
>
> > But I honestly don't have a strong opinion here, though, happy to batch
> > it if you prefer. Would this one look better?:
> >
> > if (!(pfn % MAX_ORDER_NR_PAGES))
> > cond_resched();
>
> Can't say I know the magic number here, but I think it's better to batch.
Hm. I thought cond_resched() deal with this internally, no?
We call it in pretty tight loops, like clear_contig_highpages() or
copy_folio_from_user().
I think adding external batching might be a bad move.
If calling cond_resched() often is a problem, something is wrong with
cond_resched().
--
Kiryl Shutsemau / Kirill A. Shutemov
next prev parent reply other threads:[~2026-08-11 14:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 13:32 [PATCH v5] kexec: keep the next kernel off hardware-poisoned pages Breno Leitao
2026-08-10 14:01 ` Pratyush Yadav
2026-08-10 14:42 ` Bradley Morgan
2026-08-10 14:59 ` Kiryl Shutsemau
2026-08-10 16:32 ` Mike Rapoport
2026-08-11 11:17 ` Breno Leitao
2026-08-11 11:36 ` Pratyush Yadav
2026-08-11 13:34 ` Mike Rapoport
2026-08-11 14:21 ` Kiryl Shutsemau [this message]
2026-08-11 14:51 ` Rik van Riel
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=ansuaOyItxGTBlTl@thinkstation \
--to=kas@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=david@kernel.org \
--cc=kernel-team@meta.com \
--cc=kexec@lists.infradead.org \
--cc=leitao@debian.org \
--cc=liam@infradead.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=nao.horiguchi@gmail.com \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=riel@surriel.com \
--cc=rmikey@meta.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