From: Zi Yan <ziy@nvidia.com>
To: Matt Fleming <matt@readmodwrite.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Nico Pache <npache@redhat.com>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
Dave Chinner <david@fromorbit.com>, Qi Zheng <qi.zheng@linux.dev>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Kairui Song <ryncsn@gmail.com>,
Shakeel Butt <shakeel.butt@linux.dev>,
Matthew Wilcox <willy@infradead.org>,
syzbot+c5b060ce82921a2fd500@syzkaller.appspotmail.com,
stable@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel-team@cloudflare.com,
Matt Fleming <mfleming@cloudflare.com>
Subject: Re: [PATCH] mm/huge_memory: Initialise workingset state before folio split
Date: Fri, 24 Jul 2026 16:26:44 -0400 [thread overview]
Message-ID: <CAFF6190-1325-49BE-825D-FDD9DA91CF03@nvidia.com> (raw)
In-Reply-To: <6449A238-AA0D-4EB0-8B78-2A669532AEE8@nvidia.com>
Use Lorenzo’s current email.
On 24 Jul 2026, at 16:18, Zi Yan wrote:
> On 24 Jul 2026, at 15:52, Matt Fleming wrote:
>
>> From: Matt Fleming <mfleming@cloudflare.com>
>>
>> xas_try_split() adds __GFP_ACCOUNT for page-cache xa_nodes, but
>> __folio_split() leaves the xa_state's xa_lru unset. That lets a live,
>
> But mapping_set_update() is not required for xas_split_alloc() and xas_split(),
> or at least nothing triggered for uniform split path. Why?
>
> xas_split_alloc() uses
> gfp = current_gfp_context(mapping_gfp_mask(mapping) & GFP_RECLAIM_MASK),
> whereas xas_try_split() starts with GFP_NOWAIT and follows xas_nomem()
> by adding __GFP_ACCOUNT if XA_FLAGS_ACCOUNT is set.
>
> Should xas_split_alloc() also take a gfp input and the caller gets
> gfp the same way as xas_split_alloc()?
>
>> memcg-charged xa_node exist without being linked into the mapping's
>> shadow_nodes list_lru; when reclaim later walks the list_lru it trips
>> VM_WARN_ON(!css_is_dying()).
>>
>> Use mapping_set_update() to install both the workingset update callback
>> and the shadow_nodes list_lru on the xa_state.
>>
>> Reported-by: syzbot+c5b060ce82921a2fd500@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=c5b060ce82921a2fd500
>> Fixes: 58729c04cf10 ("mm/huge_memory: add buddy allocator like (non-uniform) folio_split()")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Matt Fleming <mfleming@cloudflare.com>
>> ---
>> mm/huge_memory.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
>> index b5d1e9d4463d..12d0e0b14e83 100644
>> --- a/mm/huge_memory.c
>> +++ b/mm/huge_memory.c
>> @@ -4033,7 +4033,8 @@ static int __folio_split(struct folio *folio, unsigned int new_order,
>> gfp_t gfp;
>>
>> mapping = folio->mapping;
>> - min_order = mapping_min_folio_order(folio->mapping);
>> + mapping_set_update(&xas, mapping);
>> + min_order = mapping_min_folio_order(mapping);
>> if (new_order < min_order) {
>> ret = -EINVAL;
>> goto out;
>> --
>> 2.43.0
>
>
> Best Regards,
> Yan, Zi
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2026-07-24 20:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 19:52 Matt Fleming
2026-07-24 20:18 ` Zi Yan
2026-07-24 20:26 ` Zi Yan [this message]
2026-07-25 3:16 ` Zi Yan
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=CAFF6190-1325-49BE-825D-FDD9DA91CF03@nvidia.com \
--to=ziy@nvidia.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@fromorbit.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=kernel-team@cloudflare.com \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=matt@readmodwrite.com \
--cc=mfleming@cloudflare.com \
--cc=muchun.song@linux.dev \
--cc=npache@redhat.com \
--cc=qi.zheng@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=ryan.roberts@arm.com \
--cc=ryncsn@gmail.com \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
--cc=syzbot+c5b060ce82921a2fd500@syzkaller.appspotmail.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
all inboxes | Powered by JetHome®