linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: david@redhat.com, lorenzo.stoakes@oracle.com,
	linmiaohe@huawei.com, tony.luck@intel.com, ziy@nvidia.com,
	baolin.wang@linux.alibaba.com, Liam.Howlett@oracle.com,
	npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com,
	baohua@kernel.org, nao.horiguchi@gmail.com,
	farrah.chen@intel.com, jiaqiyan@google.com, lance.yang@linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] mm: prevent poison consumption when splitting THP
Date: Sat, 11 Oct 2025 11:18:58 -0700	[thread overview]
Message-ID: <20251011111858.952f08213da2a9018cfbe2b3@linux-foundation.org> (raw)
In-Reply-To: <20251011075520.320862-1-qiuxu.zhuo@intel.com>

On Sat, 11 Oct 2025 15:55:19 +0800 Qiuxu Zhuo <qiuxu.zhuo@intel.com> wrote:

> When performing memory error injection on a THP (Transparent Huge Page)
> mapped to userspace on an x86 server, the kernel panics with the following
> trace. The expected behavior is to terminate the affected process instead
> of panicking the kernel, as the x86 Machine Check code can recover from an
> in-userspace #MC.
> 
>   mce: [Hardware Error]: CPU 0: Machine Check Exception: f Bank 3: bd80000000070134
>   mce: [Hardware Error]: RIP 10:<ffffffff8372f8bc> {memchr_inv+0x4c/0xf0}
>   mce: [Hardware Error]: TSC afff7bbff88a ADDR 1d301b000 MISC 80 PPIN 1e741e77539027db
>   mce: [Hardware Error]: PROCESSOR 0:d06d0 TIME 1758093249 SOCKET 0 APIC 0 microcode 80000320
>   mce: [Hardware Error]: Run the above through 'mcelog --ascii'
>   mce: [Hardware Error]: Machine check: Data load in unrecoverable area of kernel
>   Kernel panic - not syncing: Fatal local machine check
> 
> The root cause of this panic is that handling a memory failure triggered by
> an in-userspace #MC necessitates splitting the THP. The splitting process
> employs a mechanism, implemented in try_to_map_unused_to_zeropage(), which
> reads the sub-pages of the THP to identify zero-filled pages. However,
> reading the sub-pages results in a second in-kernel #MC,

Well that sounds dumb.  To me this suggests a lack of selftesting code.
Perhaps someone could prepare a test for this case.

> occurring before
> the initial memory_failure() completes, ultimately leading to a kernel
> panic. See the kernel panic call trace on the two #MCs.
> 
> ...
>
> Reported-by: Farrah Chen <farrah.chen@intel.com>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Tested-by: Farrah Chen <farrah.chen@intel.com>
> Tested-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>

Yes please, a Fixes: would be good.

> +	if (folio_contain_hwpoisoned_page(folio))

Offtopic, that should have been "folio_contains_hwpoisoned_page".




  parent reply	other threads:[~2025-10-11 18:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28  3:28 [PATCH " Qiuxu Zhuo
2025-09-28 21:55 ` Jiaqi Yan
2025-09-29 12:29   ` Miaohe Lin
2025-09-29 13:57     ` Zhuo, Qiuxu
2025-09-29 15:15       ` Jiaqi Yan
2025-09-29 13:27   ` Zhuo, Qiuxu
2025-09-29 15:51     ` Luck, Tony
2025-09-29 16:30       ` Zhuo, Qiuxu
2025-09-29 17:25         ` David Hildenbrand
2025-09-30  1:48           ` Lance Yang
2025-09-30  8:53             ` David Hildenbrand
2025-09-30 10:13               ` Lance Yang
2025-09-30 10:20                 ` Lance Yang
2025-09-29  7:34 ` David Hildenbrand
2025-09-29 13:52   ` Zhuo, Qiuxu
2025-09-29 16:12     ` David Hildenbrand
2025-10-12  1:37   ` Wei Yang
2025-10-12  4:23     ` Jiaqi Yan
2025-10-11  7:55 ` [PATCH v2 " Qiuxu Zhuo
2025-10-11  9:09   ` Lance Yang
2025-10-11 18:18   ` Andrew Morton [this message]
2025-10-12  1:23   ` Wei Yang
2025-10-13 17:15   ` Zi Yan
2025-10-14  2:42   ` Miaohe Lin
2025-10-14 14:19 ` [PATCH v3 " Qiuxu Zhuo
2025-10-14 14:29   ` David Hildenbrand
2025-10-14 14:51     ` Zhuo, Qiuxu
2025-10-15  6:49 ` [PATCH v4 " Qiuxu Zhuo

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=20251011111858.952f08213da2a9018cfbe2b3@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=farrah.chen@intel.com \
    --cc=jiaqiyan@google.com \
    --cc=lance.yang@linux.dev \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=nao.horiguchi@gmail.com \
    --cc=npache@redhat.com \
    --cc=qiuxu.zhuo@intel.com \
    --cc=ryan.roberts@arm.com \
    --cc=tony.luck@intel.com \
    --cc=ziy@nvidia.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