From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Usama Arif <usama.arif@linux.dev>, Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
npache@redhat.com, linux-mm@kvack.org, matthew.brost@intel.com,
joshua.hahnjy@gmail.com, hannes@cmpxchg.org, rakie.kim@sk.com,
byungchul@sk.com, gourry@gourry.net,
ying.huang@linux.alibaba.com, apopple@nvidia.com,
linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH] mm: migrate: requeue destination folio on deferred split queue
Date: Fri, 6 Mar 2026 17:23:53 +0100 [thread overview]
Message-ID: <c6fa242b-d29e-419e-939c-d2b311ca5710@kernel.org> (raw)
In-Reply-To: <28e48b47-f215-4e4a-b55a-01dbf293ff35@linux.dev>
On 3/6/26 17:15, Usama Arif wrote:
>
>
> On 06/03/2026 14:46, Zi Yan wrote:
>> On 6 Mar 2026, at 9:12, Usama Arif wrote:
>>
>>>
>>> Yes you are right. How about something like below? We also won't need to check
>>> for anon and non-device folios with this as we only set the the flag if it was
>>> already on deferred_split list.
>>
>> BTW, migrate_pages() tries to split partially mapped folios before migration[1],
>> so what remains in the deferred_list would be:
>>
>> 1. partially mapped but with a pin,
>> 2. fully mapped but potentially underused.
>>
>
> Yes, thats right.
>
>> I wonder if you want to do an underused scan before migration and try to split
>> underused THPs.
>
> hmm, I think we should keep THPs as is if there is no memory pressure (proactive
> or otherwise). Scanning THPs for zeros has a cost and we would also lose the benefit
> of THPs when we dont need memory.
>
>> Or to avoid this additional scan, find a way of detecting
>> zero pages at page copy time and split it after migration.
>>
>
> Yeah but I think we lose the benefits of THPs after migration when we dont need
> additional memory?
>
>> Anyway, it seems that all large folios are in this deferred_list. Maybe, like
>> David suggested in his LSFMM proposal, we should scan large folios on LRU lists
>> at reclaim time instead, since there is not much difference between deferred_list
>> and LRU lists right now.
>>
>
> Yeah the THP shrinker is a very basic implementation and there are a lot of
>
>>
>> [1] https://elixir.bootlin.com/linux/v6.19.3/source/mm/migrate.c#L1840
>>
>
> Also Johannes pointed out its not great storing this information in page flags,
> we can just keep it as local variable. This is what the patch would look like:
Much cleaner.
--
Cheers,
David
next prev parent reply other threads:[~2026-03-06 16:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 13:35 Usama Arif
2026-03-06 13:49 ` David Hildenbrand (Arm)
2026-03-06 14:12 ` Usama Arif
2026-03-06 14:46 ` Zi Yan
2026-03-06 16:15 ` Usama Arif
2026-03-06 16:23 ` David Hildenbrand (Arm) [this message]
2026-03-06 16:26 ` Zi Yan
2026-03-06 16:08 ` Matthew Wilcox
2026-03-06 16:19 ` Usama Arif
2026-03-06 13:51 ` David Hildenbrand (Arm)
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=c6fa242b-d29e-419e-939c-d2b311ca5710@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=joshua.hahnjy@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=npache@redhat.com \
--cc=rakie.kim@sk.com \
--cc=usama.arif@linux.dev \
--cc=ying.huang@linux.alibaba.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