[PATCH 17/16] mm,hwpoison: introduce MF_MSG_UNSPLIT_THP

From: Naoya Horiguchi
Date: Mon Oct 21 2019 - 05:51:14 EST


On Mon, Oct 21, 2019 at 07:04:40AM +0000, Naoya Horiguchi wrote:
> On Thu, Oct 17, 2019 at 04:21:16PM +0200, Oscar Salvador wrote:
> > Place the THP's page handling in a helper and use it
> > from both hard and soft-offline machinery, so we get rid
> > of some duplicated code.
> >
> > Signed-off-by: Oscar Salvador <osalvador@xxxxxxx>
...
> > @@ -1288,21 +1307,8 @@ int memory_failure(unsigned long pfn, int flags)
> > }
> >
> > if (PageTransHuge(hpage)) {
> > - lock_page(p);
> > - if (!PageAnon(p) || unlikely(split_huge_page(p))) {
> > - unlock_page(p);
> > - if (!PageAnon(p))
> > - pr_err("Memory failure: %#lx: non anonymous thp\n",
> > - pfn);
> > - else
> > - pr_err("Memory failure: %#lx: thp split failed\n",
> > - pfn);
> > - if (TestClearPageHWPoison(p))
> > - num_poisoned_pages_dec();
> > - put_page(p);
> > + if (try_to_split_thp_page(p, "Memory Failure") < 0)
> > return -EBUSY;
>
> Although this is not a cleanup thing, this failure path means that
> hwpoison is handled (PG_hwpoison is marked), so action_result() should
> be called. I'll add a patch for this later.

Here's the one. So Oscar, If you like, could you append this to
your tree in the next spin (with your credit or signed-off-by)?

Thanks,
Naoya Horiguchi
---