[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YWZJIKsn6Sry5P6k@t490s>
Date: Wed, 13 Oct 2021 10:49:04 +0800
From: Peter Xu <peterx@...hat.com>
To: Naoya Horiguchi <naoya.horiguchi@...ux.dev>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Alistair Popple <apopple@...dia.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Konstantin Khlebnikov <koct9i@...il.com>,
Bin Wang <wangbin224@...wei.com>,
Naoya Horiguchi <naoya.horiguchi@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] mm, pagemap: expose hwpoison entry
Hi, Naoya,
On Mon, Oct 04, 2021 at 08:50:01PM +0900, Naoya Horiguchi wrote:
> +static inline struct page *hwpoison_entry_to_page(swp_entry_t entry)
> +{
> + struct page *p = pfn_to_page(swp_offset(entry));
> +
> + WARN_ON(!PageHWPoison(p));
> + return p;
> +}
This is more a pure question..
I'm wondering whether that WARN_ON() could trigger.
IOW, what if we poison an anonymous page and then unpoison it? Will there be a
hwpoison swap entry leftover in the ptes that it used to map? Will it crash
the program when the page is accessed?
I had a feeling that when handling the page fault in do_swap_page before we
SIGBUS the program, we should double-check the PageHWPoison on the pfn page,
but I could be missing something..
Thanks,
--
Peter Xu
Powered by blists - more mailing lists