From: Naoya Horiguchi <naoya.horiguchi@linux.dev>
To: Peter Xu <peterx@redhat.com>
Cc: "Yang Shi" <shy828301@gmail.com>,
"HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>,
"Hugh Dickins" <hughd@google.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Oscar Salvador" <osalvador@suse.de>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Linux MM" <linux-mm@kvack.org>,
"Linux FS-devel Mailing List" <linux-fsdevel@vger.kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [v3 PATCH 2/5] mm: filemap: check if THP has hwpoisoned subpage for PMD page fault
Date: Thu, 14 Oct 2021 15:54:32 +0900 [thread overview]
Message-ID: <20211014065432.GB2017714@u2004> (raw)
In-Reply-To: <YWZMDTwCCZWX5/sQ@t490s>
On Wed, Oct 13, 2021 at 11:01:33AM +0800, Peter Xu wrote:
> On Tue, Oct 12, 2021 at 07:48:39PM -0700, Yang Shi wrote:
> > On Tue, Oct 12, 2021 at 3:10 PM Peter Xu <peterx@redhat.com> wrote:
> > >
> > > On Tue, Oct 12, 2021 at 11:02:09AM -0700, Yang Shi wrote:
> > > > On Mon, Oct 11, 2021 at 6:44 PM Peter Xu <peterx@redhat.com> wrote:
> > > > >
> > > > > On Mon, Oct 11, 2021 at 08:55:26PM -0400, Peter Xu wrote:
> > > > > > Another thing is I noticed soft_offline_in_use_page() will still ignore file
> > > > > > backed split. I'm not sure whether it means we'd better also handle that case
> > > > > > as well, so shmem thp can be split there too?
> > > > >
> > > > > Please ignore this paragraph - I somehow read "!PageHuge(page)" as
> > > > > "PageAnon(page)"... So I think patch 5 handles soft offline too.
> > > >
> > > > Yes, exactly. And even though the split is failed (or file THP didn't
> > > > get split before patch 5/5), soft offline would just return -EBUSY
> > > > instead of calling __soft_offline_page->page_handle_poison(). So
> > > > page_handle_poison() should not see THP at all.
> > >
> > > I see, so I'm trying to summarize myself on what I see now with the new logic..
> > >
> > > I think the offline code handles hwpoison differently as it sets PageHWPoison
> > > at the end of the process, IOW if anything failed during the offline process
> > > the hwpoison bit is not set.
> > >
> > > That's different from how the memory failure path is handling this, as in that
> > > case the hwpoison bit on the subpage is set firstly, e.g. before split thp. I
> > > believe that's also why memory failure requires the extra sub-page-hwpoison bit
> > > while offline code shouldn't need to: because for soft offline split happens
> > > before setting hwpoison so we just won't ever see a "poisoned file thp", while
> > > for memory failure it could happen, and the sub-page-hwpoison will be a temp
> > > bit anyway only exist for a very short period right after we set hwpoison on
> > > the small page but before we split the thp.
> > >
> > > Am I right above?
> >
> > Yeah, you are right. I noticed this too, only successfully migrated
> > page is marked as hwpoison. But TBH I'm not sure why it does this way.
>
> My wild guess is that unlike memory failures, soft offline is best-effort. Say,
> the data on the page is still consistent, so even if offline failed for some
> reason we shouldn't stop the program from execution. That's not true for
> memory failures via MCEs, afaict, as the execution could read/write wrong data
> and that'll be a serious mistake, so we set hwpoison 1st there first before
> doing anything else, making sure "this page is broken" message delivered and
> user app won't run with risk.
>
> But yeah it'll be great if Naoya could help confirm that.
Yes, these descriptions are totally correct, how PG_hwpoison flag is set
is different between hwpoison/soft-offline mechanisms from the beginning.
Thanks,
Naoya Horiguchi
next prev parent reply other threads:[~2021-10-14 6:54 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 21:53 [RFC v3 PATCH 0/5] Solve silent data loss caused by poisoned page cache (shmem/tmpfs) Yang Shi
2021-09-30 21:53 ` [v3 PATCH 1/5] mm: hwpoison: remove the unnecessary THP check Yang Shi
2021-10-06 2:35 ` Yang Shi
2021-10-06 4:00 ` Naoya Horiguchi
2021-10-06 17:56 ` Yang Shi
2021-09-30 21:53 ` [v3 PATCH 2/5] mm: filemap: check if THP has hwpoisoned subpage for PMD page fault Yang Shi
2021-10-01 7:23 ` Naoya Horiguchi
2021-10-01 21:07 ` Yang Shi
2021-10-04 14:06 ` Kirill A. Shutemov
2021-10-04 18:17 ` Yang Shi
2021-10-04 19:41 ` Kirill A. Shutemov
2021-10-04 20:13 ` Yang Shi
2021-10-06 19:54 ` Peter Xu
2021-10-06 23:41 ` Yang Shi
2021-10-07 16:14 ` Peter Xu
2021-10-07 18:28 ` Yang Shi
2021-10-08 9:35 ` Kirill A. Shutemov
2021-10-11 22:57 ` Peter Xu
2021-10-06 20:15 ` Peter Xu
2021-10-06 23:57 ` Yang Shi
2021-10-07 16:06 ` Peter Xu
2021-10-07 18:19 ` Yang Shi
2021-10-07 20:27 ` Yang Shi
2021-10-07 21:28 ` Yang Shi
2021-10-12 0:55 ` Peter Xu
2021-10-12 1:44 ` Peter Xu
2021-10-12 18:02 ` Yang Shi
2021-10-12 22:10 ` Peter Xu
2021-10-13 2:48 ` Yang Shi
2021-10-13 3:01 ` Peter Xu
2021-10-13 3:27 ` Yang Shi
2021-10-13 3:41 ` Peter Xu
2021-10-13 21:42 ` Yang Shi
2021-10-13 23:13 ` Peter Xu
2021-10-14 6:54 ` Naoya Horiguchi [this message]
2021-10-06 20:18 ` Peter Xu
2021-10-07 2:49 ` Yang Shi
2021-11-01 19:05 ` Naresh Kamboju
2021-11-01 19:26 ` Yang Shi
2021-09-30 21:53 ` [v3 PATCH 3/5] mm: hwpoison: refactor refcount check handling Yang Shi
2021-10-06 22:01 ` Peter Xu
2021-10-07 2:47 ` Yang Shi
2021-10-07 16:18 ` Peter Xu
2021-09-30 21:53 ` [v3 PATCH 4/5] mm: shmem: don't truncate page if memory failure happens Yang Shi
2021-10-01 7:05 ` Naoya Horiguchi
2021-10-01 21:08 ` Yang Shi
2021-10-12 1:57 ` Peter Xu
2021-10-12 19:17 ` Yang Shi
2021-10-12 22:26 ` Peter Xu
2021-10-13 3:00 ` Yang Shi
2021-10-13 3:06 ` Peter Xu
2021-10-13 3:29 ` Yang Shi
2021-09-30 21:53 ` [v3 PATCH 5/5] mm: hwpoison: handle non-anonymous THP correctly Yang Shi
2021-10-01 7:06 ` Naoya Horiguchi
2021-10-01 21:09 ` Yang Shi
2021-10-13 2:40 ` [RFC v3 PATCH 0/5] Solve silent data loss caused by poisoned page cache (shmem/tmpfs) Peter Xu
2021-10-13 3:09 ` Yang Shi
2021-10-13 3:24 ` Peter Xu
2021-10-14 6:54 ` Naoya Horiguchi
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=20211014065432.GB2017714@u2004 \
--to=naoya.horiguchi@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=naoya.horiguchi@nec.com \
--cc=osalvador@suse.de \
--cc=peterx@redhat.com \
--cc=shy828301@gmail.com \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).