lkml.org 
[lkml]   [2021]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-10-13 04:49    [W:0.125 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site