All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Alistair Popple <apopple@nvidia.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Konstantin Khlebnikov <koct9i@gmail.com>,
	Bin Wang <wangbin224@huawei.com>,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] mm, pagemap: expose hwpoison entry
Date: Wed, 13 Oct 2021 10:49:04 +0800	[thread overview]
Message-ID: <YWZJIKsn6Sry5P6k@t490s> (raw)
In-Reply-To: <20211004115001.1544259-1-naoya.horiguchi@linux.dev>

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



  parent reply	other threads:[~2021-10-13  2:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 11:50 [PATCH v1] mm, pagemap: expose hwpoison entry Naoya Horiguchi
2021-10-04 11:55 ` David Hildenbrand
2021-10-04 14:32   ` Naoya Horiguchi
2021-10-26 23:27     ` Naoya Horiguchi
2021-10-27  2:09       ` Peter Xu
2021-10-27  6:45         ` Naoya Horiguchi
2021-10-27  7:02           ` Peter Xu
2021-10-27  7:15             ` David Hildenbrand
2021-10-04 20:17 ` kernel test robot
2021-10-04 20:17   ` kernel test robot
2021-10-05  2:53 ` kernel test robot
2021-10-05  2:53   ` kernel test robot
2021-10-13  2:49 ` Peter Xu [this message]
2021-10-14 13:36   ` Naoya Horiguchi
2021-10-14 23:32     ` Peter Xu

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=YWZJIKsn6Sry5P6k@t490s \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=naoya.horiguchi@linux.dev \
    --cc=naoya.horiguchi@nec.com \
    --cc=wangbin224@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.