From: Dan Williams <dan.j.williams@intel.com>
To: Joao Martins <joao.m.martins@oracle.com>
Cc: Jane Chu <jane.chu@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
Naoya Horiguchi <naoya.horiguchi@nec.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC] Missing compound_head() in memory-failure
Date: Tue, 1 Feb 2022 14:20:43 -0800 [thread overview]
Message-ID: <CAPcyv4jWam1pR12+W94KyMP9nCRKwXMnY1NmcD16-MzVuOXWJA@mail.gmail.com> (raw)
In-Reply-To: <1a034e3d-3119-2947-843d-f9699af0d03a@oracle.com>
On Tue, Feb 1, 2022 at 2:05 PM Joao Martins <joao.m.martins@oracle.com> wrote:
>
> On 2/1/22 21:11, Jane Chu wrote:
> > On 2/1/2022 7:46 AM, Matthew Wilcox wrote:
> >> On Mon, Jan 31, 2022 at 08:54:39PM +0000, Joao Martins wrote:
> >>> On 1/31/22 20:29, Matthew Wilcox wrote:
> >>>> Unless I am mistaken, you have to pass the compound head of the page
> >>>> which has the error to collect_procs(). Am I mistaken?
> >>>>
> >>> -rc2 already has a fix for it:
> >>>
> >>> https://lore.kernel.org/linux-mm/20220129021420.PgBIZm-q9%25akpm@linux-foundation.org/
> >>>
> >>> Earlier in that function there's a:
> >>>
> >>> page = compound_head(page);
> >>>
> >>> So the @page passed to collect_procs() already is a head page.
> >>
> >> It's wrong though ;-( You set the HWPoison bit on the page after
> >> calling compound_head(), so you set the bit on the head page instead
> >> of the precise page that had the poison.
> >
> > Indeed. The rest of the kernel including pmem driver still deal with
> > base page on clearing poison, bookkeeping etc. So the HWpoison bit needs
> > to be set precisely on the poisoned base page such that we pass the
> > correct 'pfn' to set_mce_nospec() to discourage speculative access.
> >
> set_mce_nospec() machinery makes no use of the HWPoison bit as far as
> my reading goes. And the PFN that is passed to set_mce_nospec() is already
> the subpage PFN that eventually lands on set_memory_np()/set_memory_uc() when
> it changes the kernel page tables mapping (which also don't use the poison bit).
>
> I still can't see how device-dax machinery makes use of that bit? At least
> the one which could use it (clear_mce_nospec()) doesn't actually go through
> device-dax nvdimm-specific code only fsdax which I reiterate that the patch
> does not change as there's no compound head there. Am I missing something?
device-dax does not use that bit, because there is no kernel mediated
access to the backing range. In the fsdax case that bit is used to
determine when to run clear_mce_nospec(). Jane is in the process of
reworking this path.
next prev parent reply other threads:[~2022-02-01 22:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-31 20:29 [RFC] Missing compound_head() in memory-failure Matthew Wilcox
2022-01-31 20:54 ` Joao Martins
2022-02-01 2:34 ` Matthew Wilcox
2022-02-01 15:46 ` Matthew Wilcox
2022-02-01 16:01 ` Joao Martins
2022-02-01 17:40 ` Joao Martins
2022-02-01 17:47 ` Matthew Wilcox
2022-02-01 18:34 ` Joao Martins
2022-02-01 21:11 ` Jane Chu
2022-02-01 22:04 ` Joao Martins
2022-02-01 22:20 ` Dan Williams [this message]
2022-02-01 23:04 ` Jane Chu
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=CAPcyv4jWam1pR12+W94KyMP9nCRKwXMnY1NmcD16-MzVuOXWJA@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=akpm@linux-foundation.org \
--cc=jane.chu@oracle.com \
--cc=joao.m.martins@oracle.com \
--cc=linux-mm@kvack.org \
--cc=naoya.horiguchi@nec.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).