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: Fri, 15 Oct 2021 07:32:45 +0800 [thread overview]
Message-ID: <YWi+HRiXju7NEkbX@t490s> (raw)
In-Reply-To: <20211014133644.GA2023135@u2004>
On Thu, Oct 14, 2021 at 10:36:44PM +0900, Naoya Horiguchi wrote:
> Thanks for the good question, this could trigger WARN for unpoisoned pages.
> The impact is limited because the caller of unpoison should know that that
> happens in testing workload, but maybe there's no good reason to prevent
> from it. So I'll drop this WARN_ON().
Sounds good, thanks.
> > 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..
>
> The double-checking seems to allow processes to detect that the hwpoison page
> is unpoisoned, some test programs could benefit from it. But maybe it could
> be done independent of this patch.
>
> Personally, I only use unpoison in cleanup phase of each test case,
> and each test case newly starts test processes, so reusing error pages
> with unpoison can be avoided.
I see. We don't have anything like soft-online a page, do we?
I also don't know whether hwpoison can be used in any other form besides
testing the hwpoison code path. E.g. logically it can be used to forbid
accessing a physical page for any reason then recover using unhwpoison?
Uffd has the SIGBUS mode that can do similar thing to the virtual address
space, so any access to some page will generate a SIGBUS. While hwpoison is
phsical address space based from that pov, and just like uffd it doesn't need
to change vma layout which should be a good property unlike mprotect(). But I
totally have no clue on all these... so it's just wild idea.
Anyway, agreed on above, even if it's applicable it should be a separate patch.
Thanks,
--
Peter Xu
prev parent reply other threads:[~2021-10-14 23:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 11:50 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-05 2:53 ` kernel test robot
2021-10-13 2:49 ` Peter Xu
2021-10-14 13:36 ` Naoya Horiguchi
2021-10-14 23:32 ` Peter Xu [this message]
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=YWi+HRiXju7NEkbX@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox