linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: "David Hildenbrand (arm)" <david@kernel.org>
Cc: 是参差 <shicenci@gmail.com>,
	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 15:13:49 -0500	[thread overview]
Message-ID: <86002E57-58EB-4940-A7F0-7AE4A60484DF@nvidia.com> (raw)
In-Reply-To: <11399c99-f966-47be-bbb4-a7d4e79c8c38@kernel.org>

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

> On 2/4/26 20:48, Zi Yan wrote:
>> On 4 Feb 2026, at 14:18, David Hildenbrand (arm) wrote:
>>
>>> On 2/4/26 18:41, Zi Yan wrote:
>>>>
>>>>
>>>> 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.
>>
>> What do you mean? Changing memory failure code to only handle large_rmappable?
>> large_rmappable is a folio flag, memory failure code should see such
>
> Did you mean "should not" ? :)

Yes.

>
>> non-folio but compound things to begin with, IMHO.
>
> I would say that we could right now reject in memory failure code any compound pages that do not have PG_large_rmappable set.
>
> I have the faint recollection that we don't set PG_large_rmappable on hugetlb folios yet, so they have to identified as well.

Right. My patchset[1] is trying to add it, since hugetlb is used as a folio
in most places and large_rmappable is a folio flag.


[1] https://lore.kernel.org/all/20260130034818.472804-1-ziy@nvidia.com/
>>
>> I think we need to be able to tell between raw page (compound or not),
>> mappable page (compound or not, especially for those used with vm_insert_*),
>> and folio.
>
> We can't identify (small) folios just yet. We'd need another page flag for that (just like PG_large_rmappable), and we all know how that ends ;)

Yes, I am thinking about removing mapcount in struct page to achieve that.
And only pages used for vm_insert_*() and folios need mapcount. Code
uses vm_insert_*() on pages would probably have a struct mappable_page
with mapcount.

>
> With Willy's work we'll be able to identify folios reliably.
>
> How to deal with that vm_insert_* crap, especially for non-folio pages, is also future work based on that.

I think it might the other way around. memdesc does not have mapcount,
if we do not have a separate struct for these mappable pages now,
what do we use at memdesc time? folio?


Best Regards,
Yan, Zi


  reply	other threads:[~2026-02-04 20:14 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 [this message]
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
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=86002E57-58EB-4940-A7F0-7AE4A60484DF@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