linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: "David Hildenbrand (arm)" <david@kernel.org>, 是参差 <shicenci@gmail.com>
Cc: linux-mm@kvack.org, linmiaohe@huawei.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: WARNING in memory_failure() at include/linux/huge_mm.h:635 triggered
Date: Wed, 04 Feb 2026 16:08:50 -0500	[thread overview]
Message-ID: <61BBEF63-20D6-4671-B7F7-F015D49B2080@nvidia.com> (raw)
In-Reply-To: <e97d5c0c-b8ec-4da4-b838-7a308f8a6327@kernel.org>

On 4 Feb 2026, at 14:18, David Hildenbrand (arm) wrote:

> On 2/4/26 18:41, Zi Yan wrote:
>> On 4 Feb 2026, at 12:34, Zi Yan wrote:
>>
>>> On 4 Feb 2026, at 12:23, Zi Yan wrote:
>>>
>>>>
>>>>
>>>>  From the C repro above, syzbot opened a dev "/dev/sg#" and did mmap on it.
>>>> Is it a device driver issue?
>>>
>>> OK, it is CONFIG_CHR_DEV_SG. And the driver allocates a compound page at[1].
>>> Since we initialize folio fields in prep_compound_page(), it becomes a folio
>>> when it is inserted into a VMA.
>>
>> More details:
>> later at sg_vma_fault(), the driver just handles a page fault by supplying
>> a subpage from a pre-allocated compound page[3]. We then get a large folio
>> without !CONFIG_TRANSPARENT_HUGEPAGE.
>
> We can identify such non-folio (but compound) things by looking at PG_large_rmappable IIRC.

OK, back to the issue. The patch below should fix the issue?

Hi 是参差,

Can you test it?

From fa4a900e027a0c7365a9f786840943990d5da971 Mon Sep 17 00:00:00 2001
From: Zi Yan <ziy@nvidia.com>
Date: Wed, 4 Feb 2026 16:04:19 -0500
Subject: [PATCH] mm/memory_failure: reject unsupported non-folio compound page

Signed-off-by: Zi Yan <ziy@nvidia.com>
---
 mm/memory-failure.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 825c706ac576..4ed903de9a0e 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2440,9 +2440,12 @@ int memory_failure(unsigned long pfn, int flags)

 	folio = page_folio(p);

-	/* filter pages that are protected from hwpoison test by users */
+	/*
+	 * filter pages that are protected from hwpoison test by users
+	 * or unsupported non folio compound pages
+	 */
 	folio_lock(folio);
-	if (hwpoison_filter(p)) {
+	if (hwpoison_filter(p) || !folio_test_large_rmappable(folio)) {
 		ClearPageHWPoison(p);
 		folio_unlock(folio);
 		folio_put(folio);
-- 
2.51.0



Best Regards,
Yan, Zi


  parent reply	other threads:[~2026-02-04 21:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 12:49 是参差
2026-02-04 17:12 ` David Hildenbrand (arm)
2026-02-04 17:15   ` David Hildenbrand (arm)
2026-02-04 17:23     ` Zi Yan
2026-02-04 17:34       ` Zi Yan
2026-02-04 17:41         ` Zi Yan
2026-02-04 19:18           ` David Hildenbrand (arm)
2026-02-04 19:48             ` Zi Yan
2026-02-04 19:55               ` David Hildenbrand (arm)
2026-02-04 20:13                 ` Zi Yan
2026-02-04 20:31                   ` David Hildenbrand (arm)
2026-02-04 20:45                     ` Zi Yan
2026-02-04 21:14                       ` David Hildenbrand (arm)
2026-02-04 21:08             ` Zi Yan [this message]
2026-02-04 21:37               ` David Hildenbrand (arm)
2026-02-04 21:41                 ` Zi Yan
2026-02-05  2:00                   ` jane.chu
2026-02-05  3:21                     ` Miaohe Lin
2026-02-05  3:53                       ` Zi Yan
2026-02-05  7:18                         ` Miaohe Lin

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=61BBEF63-20D6-4671-B7F7-F015D49B2080@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shicenci@gmail.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