From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"aris@ruivo.org" <aris@ruivo.org>,
"mhocko@kernel.org" <mhocko@kernel.org>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"cai@lca.pw" <cai@lca.pw>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH v4 1/7] mm,hwpoison: take free pages off the buddy freelists
Date: Fri, 25 Sep 2020 02:22:15 +0000 [thread overview]
Message-ID: <20200925022214.GA31132@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <20200917081049.27428-2-osalvador@suse.de>
On Thu, Sep 17, 2020 at 10:10:43AM +0200, Oscar Salvador wrote:
> The crux of the matter is that historically we left poisoned pages in the
> buddy system because we have some checks in place when allocating a page
> that a gatekeeper for poisoned pages. Unfortunately, we do have other
> users (e.g: compaction [1]) that scan buddy freelists and try to get a
> page from there without checking whether the page is HWPoison.
>
> As I stated already, I think it is fundamentally wrong to keep HWPoison
> pages within the buddy systems, checks in place or not.
>
> Let us fix this we same way we did for soft_offline [2], and take the page
> off the buddy freelist, so it is completely unreachable.
>
> Note that this is fairly simple to trigger, as we only need to poison free
> buddy pages (madvise MADV_HWPOISON) and then we need to run some sort of
> memory stress system.
>
> Just for a matter of reference, I put a dump_page in compaction_alloc to
> trigger for HWPoison patches:
>
> kernel: page:0000000012b2982b refcount:1 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1d5db
> kernel: flags: 0xfffffc0800000(hwpoison)
> kernel: raw: 000fffffc0800000 ffffea00007573c8 ffffc90000857de0 0000000000000000
> kernel: raw: 0000000000000001 0000000000000000 00000001ffffffff 0000000000000000
> kernel: page dumped because: compaction_alloc
>
> kernel: CPU: 4 PID: 123 Comm: kcompactd0 Tainted: G E 5.9.0-rc2-mm1-1-default+ #5
> kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.2-0-g5f4c7b1-prebuilt.qemu-project.org 04/01/2014
> kernel: Call Trace:
> kernel: dump_stack+0x6d/0x8b
> kernel: compaction_alloc+0xb2/0xc0
> kernel: migrate_pages+0x2a6/0x12a0
> kernel: ? isolate_freepages+0xc80/0xc80
> kernel: ? __ClearPageMovable+0xb0/0xb0
> kernel: compact_zone+0x5eb/0x11c0
> kernel: ? finish_task_switch+0x74/0x300
> kernel: ? lock_timer_base+0xa8/0x170
> kernel: proactive_compact_node+0x89/0xf0
> kernel: ? kcompactd+0x2d0/0x3a0
> kernel: kcompactd+0x2d0/0x3a0
> kernel: ? finish_wait+0x80/0x80
> kernel: ? kcompactd_do_work+0x350/0x350
> kernel: kthread+0x118/0x130
> kernel: ? kthread_associate_blkcg+0xa0/0xa0
> kernel: ret_from_fork+0x22/0x30
>
> After that, if e.g: someone faults in the page, that someone will get
> killed unexpectedly.
>
> While we are at it, I also changed the action result for such cases.
> I think that MF_DELAYED is a bit misleading, because in case we could
> contain the page and take it off the buddy, such a page is not to be used
> again unless it is unpoisoned, so we fixed the situation.
>
> So unless I am missing something, I strongly think that we should report
> MF_RECOVERED.
>
> [1] https://lore.kernel.org/linux-mm/20190826104144.GA7849@linux/T/#u
> [2] https://patchwork.kernel.org/patch/11694847/
>
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
next prev parent reply other threads:[~2020-09-25 2:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 8:10 [PATCH v4 0/7] HWpoison: further fixes and cleanups Oscar Salvador
2020-09-17 8:10 ` [PATCH v4 1/7] mm,hwpoison: take free pages off the buddy freelists Oscar Salvador
2020-09-25 2:22 ` HORIGUCHI NAOYA(堀口 直也) [this message]
2020-09-17 8:10 ` [PATCH v4 2/7] mm,hwpoison: Do not set hugepage_or_freepage unconditionally Oscar Salvador
2020-09-18 19:26 ` Aristeu Rozanski
2020-09-17 8:10 ` [PATCH v4 3/7] mm,hwpoison: Try to narrow window race for free pages Oscar Salvador
2020-09-18 19:27 ` Aristeu Rozanski
2020-09-17 8:10 ` [PATCH v4 4/7] mm,hwpoison: refactor madvise_inject_error Oscar Salvador
2020-09-17 8:10 ` [PATCH v4 5/7] mm,hwpoison: drain pcplists before bailing out for non-buddy zero-refcount page Oscar Salvador
2020-09-25 2:22 ` HORIGUCHI NAOYA(堀口 直也)
2020-09-17 8:10 ` [PATCH v4 6/7] mm,hwpoison: drop unneeded pcplist draining Oscar Salvador
2020-09-17 8:10 ` [PATCH v4 7/7] mm,hwpoison: remove stale code Oscar Salvador
2020-09-17 11:39 ` [PATCH v4 0/7] HWpoison: further fixes and cleanups HORIGUCHI NAOYA(堀口 直也)
2020-09-17 13:09 ` Oscar Salvador
2020-09-17 13:40 ` Oscar Salvador
2020-09-17 15:27 ` HORIGUCHI NAOYA(堀口 直也)
2020-09-18 5:49 ` osalvador
2020-09-18 19:25 ` aris
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=20200925022214.GA31132@hori.linux.bs1.fc.nec.co.jp \
--to=naoya.horiguchi@nec.com \
--cc=akpm@linux-foundation.org \
--cc=aris@ruivo.org \
--cc=cai@lca.pw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=osalvador@suse.de \
--cc=tony.luck@intel.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