From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: 王贇 <yun.wang@linux.alibaba.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"open list:HWPOISON MEMORY FAILURE HANDLING" <linux-mm@kvack.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: fix panic caused by __page_handle_poison()
Date: Tue, 31 Aug 2021 09:11:35 +0000 [thread overview]
Message-ID: <20210831091134.GA1075738@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <58b6b733-b021-7eb8-4226-1b98d50c8c82@linux.alibaba.com>
On Mon, Aug 30, 2021 at 06:07:56PM +0800, 王贇 wrote:
> By commit 510d25c92ec4 ("mm/hwpoison: disable pcp for
> page_handle_poison()"), __page_handle_poison() was
> introduced, and if we mark:
>
> RET_A = dissolve_free_huge_page();
> RET_B = take_page_off_buddy();
>
> then __page_handle_poison was supposed to return TRUE When
> RET_A == 0 && RET_B == TRUE
>
> But since it failed to take care the case when RET_A is
> -EBUSY or -ENOMEM, and just return the ret as a bool which
> actually become TRUE, it break the original logical.
s/logical/logic/ ?
>
> The following result is a huge page in freelist but was
> referenced as poisoned, and lead into the final panic:
>
> kernel BUG at mm/internal.h:95!
> invalid opcode: 0000 [#1] SMP PTI
> skip...
> RIP: 0010:set_page_refcounted mm/internal.h:95 [inline]
> RIP: 0010:remove_hugetlb_page+0x23c/0x240 mm/hugetlb.c:1371
> skip...
> Call Trace:
> remove_pool_huge_page+0xe4/0x110 mm/hugetlb.c:1892
> return_unused_surplus_pages+0x8d/0x150 mm/hugetlb.c:2272
> hugetlb_acct_memory.part.91+0x524/0x690 mm/hugetlb.c:4017
>
> This patch replace 'bool' with 'int' to handle RET_A correctly.
>
> Reported-by: Abaci <abaci@linux.alibaba.com>
> Signed-off-by: Michael Wang <yun.wang@linux.alibaba.com>
Thank you very much, this fix is totally right.
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Could you add the following tags, too?
Fixes: 510d25c92ec4 ("mm/hwpoison: disable pcp for page_handle_poison()")
Cc: <stable@vger.kernel.org> # 5.14
Thanks,
Naoya Horiguchi
next prev parent reply other threads:[~2021-08-31 9:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-30 10:07 王贇
2021-08-31 9:11 ` HORIGUCHI NAOYA(堀口 直也) [this message]
2021-08-31 9:35 ` 王贇
2021-08-31 9:37 ` [PATCH v2] " 王贇
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=20210831091134.GA1075738@hori.linux.bs1.fc.nec.co.jp \
--to=naoya.horiguchi@nec.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yun.wang@linux.alibaba.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