The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	 kexec@lists.infradead.org, rmikey@meta.com, riel@surriel.com,
	kernel-team@meta.com,  Kiryl Shutsemau <kas@kernel.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>,
	 Mike Rapoport <rppt@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>,
	 Naoya Horiguchi <nao.horiguchi@gmail.com>
Subject: Re: [PATCH] kexec: keep the next kernel off hardware-poisoned pages
Date: Wed, 29 Jul 2026 03:17:31 -0700	[thread overview]
Message-ID: <amnSy6PFh57T0buv@gmail.com> (raw)
In-Reply-To: <16c18549-c9a1-ba55-91b8-52d9368ebbc0@huawei.com>

On Wed, Jul 29, 2026 at 05:33:17PM +0800, Miaohe Lin wrote:

> > +		if (pfn_valid(pfn) && PageHWPoison(pfn_to_page(pfn)))
> 
> Should we use pfn_to_online_page here? I doubt we might meet the same problem
> in [1] if pfn_to_page is used here.

Good catch, thanks -- yes.  An offlined but not removed block is still
pfn_valid() while its struct page is uninitialized, so PageHWPoison()
on it hits VM_BUG_ON_PAGE(PagePoisoned(page)), the same failure as
commit d613f53c83ec ("mm/memory-failure: fix
VM_BUG_ON_PAGE(PagePoisoned(page)) when unpoison memory") fixes.

I'll switch to pfn_to_online_page() in v2:

      for (pfn = PHYS_PFN(start); pfn <= end_pfn; pfn++) {
              struct page *page = pfn_to_online_page(pfn);

              if (page && PageHWPoison(page))
                      return true;
      }

Thanks for the review.
--breno

  reply	other threads:[~2026-07-29 10:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 16:22 [PATCH] kexec: keep the next kernel off hardware-poisoned pages Breno Leitao
2026-07-29  9:33 ` Miaohe Lin
2026-07-29 10:17   ` Breno Leitao [this message]
2026-07-29 11:57 ` Pratyush Yadav
2026-07-29 16:47   ` Breno Leitao

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=amnSy6PFh57T0buv@gmail.com \
    --to=leitao@debian.org \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=david@kernel.org \
    --cc=kas@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kexec@lists.infradead.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