public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3] mm: migrate: requeue destination folio on deferred split queue
       [not found]   ` <20260312175241.01b876f3b325264f43312d79@linux-foundation.org>
@ 2026-03-13 10:40     ` Usama Arif
  2026-03-14 22:40       ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Usama Arif @ 2026-03-13 10:40 UTC (permalink / raw)
  To: Andrew Morton, SeongJae Park
  Cc: npache, david, ziy, willy, linux-mm, matthew.brost, joshua.hahnjy,
	hannes, rakie.kim, byungchul, gourry, ying.huang, apopple,
	linux-kernel, kernel-team, richard.weiyang, stable



On 13/03/2026 03:52, Andrew Morton wrote:
> On Thu, 12 Mar 2026 17:16:30 -0700 SeongJae Park <sj@kernel.org> wrote:
> 
>>> By the time migrate_folio_move() runs, partially mapped folios without a
>>> pin have already been split by migrate_pages_batch().  So only two cases
>>> remain on the deferred list at this point:
>>>   1. Partially mapped folios with a pin (split failed).
>>>   2. Fully mapped but potentially underused folios.
>>> The recorded partially_mapped state is forwarded to deferred_split_folio()
>>> so that the destination folio is correctly re-queued in both cases.
>>>
>>> Reported-by: Johannes Weiner <hannes@cmpxchg.org>
>>> Fixes: dafff3f4c850 ("mm: split underused THPs")
>>
>> Seems the commit is merged in 6.12.  And I assume the user impact on
>> THP-shrinker enabled systems is visible.  If so, should we Cc stable@ ?
> 
> I think the user impact should be visible to backport, but the
> changelog is elusive on details?
> 


The original patches added THPs to deferred_list at fault/collapse, they
got removed but not added back to the list after migration.
This patch adds them to the deferred_list on migration. The user would
not expect the THPs to get removed from deferred_list on migration, so
this fixes user expectations.

I have CC-ed stable@vger.kernel.org to this email. Should I resend the patch
with CC stable in commit message?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] mm: migrate: requeue destination folio on deferred split queue
  2026-03-13 10:40     ` [PATCH v3] mm: migrate: requeue destination folio on deferred split queue Usama Arif
@ 2026-03-14 22:40       ` Andrew Morton
  2026-03-15  0:05         ` SeongJae Park
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2026-03-14 22:40 UTC (permalink / raw)
  To: Usama Arif
  Cc: SeongJae Park, npache, david, ziy, willy, linux-mm, matthew.brost,
	joshua.hahnjy, hannes, rakie.kim, byungchul, gourry, ying.huang,
	apopple, linux-kernel, kernel-team, richard.weiyang, stable

On Fri, 13 Mar 2026 13:40:29 +0300 Usama Arif <usama.arif@linux.dev> wrote:

> 
> 
> On 13/03/2026 03:52, Andrew Morton wrote:
> > On Thu, 12 Mar 2026 17:16:30 -0700 SeongJae Park <sj@kernel.org> wrote:
> > 
> >>> By the time migrate_folio_move() runs, partially mapped folios without a
> >>> pin have already been split by migrate_pages_batch().  So only two cases
> >>> remain on the deferred list at this point:
> >>>   1. Partially mapped folios with a pin (split failed).
> >>>   2. Fully mapped but potentially underused folios.
> >>> The recorded partially_mapped state is forwarded to deferred_split_folio()
> >>> so that the destination folio is correctly re-queued in both cases.
> >>>
> >>> Reported-by: Johannes Weiner <hannes@cmpxchg.org>
> >>> Fixes: dafff3f4c850 ("mm: split underused THPs")
> >>
> >> Seems the commit is merged in 6.12.  And I assume the user impact on
> >> THP-shrinker enabled systems is visible.  If so, should we Cc stable@ ?
> > 
> > I think the user impact should be visible to backport, but the
> > changelog is elusive on details?
> > 
> 
> 
> The original patches added THPs to deferred_list at fault/collapse, they
> got removed but not added back to the list after migration.
> This patch adds them to the deferred_list on migration. The user would
> not expect the THPs to get removed from deferred_list on migration, so
> this fixes user expectations.

Maybe users just won't notice?

If we can't identify any benefit to userspace then I don't think this
patch meets the criteria for backporting.

> I have CC-ed stable@vger.kernel.org to this email. Should I resend the patch
> with CC stable in commit message?

That's OK, I update changelogs.  A lot.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] mm: migrate: requeue destination folio on deferred split queue
  2026-03-14 22:40       ` Andrew Morton
@ 2026-03-15  0:05         ` SeongJae Park
  2026-03-15  0:23           ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: SeongJae Park @ 2026-03-15  0:05 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Usama Arif, npache, david, ziy, willy, linux-mm,
	matthew.brost, joshua.hahnjy, hannes, rakie.kim, byungchul,
	gourry, ying.huang, apopple, linux-kernel, kernel-team,
	richard.weiyang, stable

On Sat, 14 Mar 2026 15:40:42 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 13 Mar 2026 13:40:29 +0300 Usama Arif <usama.arif@linux.dev> wrote:
> 
> > 
> > 
> > On 13/03/2026 03:52, Andrew Morton wrote:
> > > On Thu, 12 Mar 2026 17:16:30 -0700 SeongJae Park <sj@kernel.org> wrote:
> > > 
> > >>> By the time migrate_folio_move() runs, partially mapped folios without a
> > >>> pin have already been split by migrate_pages_batch().  So only two cases
> > >>> remain on the deferred list at this point:
> > >>>   1. Partially mapped folios with a pin (split failed).
> > >>>   2. Fully mapped but potentially underused folios.
> > >>> The recorded partially_mapped state is forwarded to deferred_split_folio()
> > >>> so that the destination folio is correctly re-queued in both cases.
> > >>>
> > >>> Reported-by: Johannes Weiner <hannes@cmpxchg.org>
> > >>> Fixes: dafff3f4c850 ("mm: split underused THPs")
> > >>
> > >> Seems the commit is merged in 6.12.  And I assume the user impact on
> > >> THP-shrinker enabled systems is visible.  If so, should we Cc stable@ ?
> > > 
> > > I think the user impact should be visible to backport, but the
> > > changelog is elusive on details?
> > > 
> > 
> > 
> > The original patches added THPs to deferred_list at fault/collapse, they
> > got removed but not added back to the list after migration.
> > This patch adds them to the deferred_list on migration. The user would
> > not expect the THPs to get removed from deferred_list on migration, so
> > this fixes user expectations.
> 
> Maybe users just won't notice?

My guess of the user-visible consequence was like following.  Because THPs are
removed from the deferred_list, THP shinker cannot split the underutilized THPs
in time.  As a result, users will show less free memory than before.  I believe
I might be wrong and Usama can correct me in the case.


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] mm: migrate: requeue destination folio on deferred split queue
  2026-03-15  0:05         ` SeongJae Park
@ 2026-03-15  0:23           ` Andrew Morton
  2026-03-20 11:41             ` David Hildenbrand (Arm)
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2026-03-15  0:23 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Usama Arif, npache, david, ziy, willy, linux-mm, matthew.brost,
	joshua.hahnjy, hannes, rakie.kim, byungchul, gourry, ying.huang,
	apopple, linux-kernel, kernel-team, richard.weiyang, stable

On Sat, 14 Mar 2026 17:05:54 -0700 SeongJae Park <sj@kernel.org> wrote:

>  Because THPs are
> removed from the deferred_list, THP shinker cannot split the underutilized THPs
> in time.  As a result, users will show less free memory than before.

That'll do, thanks ;)

Pasted, added cc:stable.  It's been there since 6.12 so I don't see a
need to rush this in, so I won't move this into mm-hotfixes - it'll go
into mainline for 7.1-rc1 after which -stable should pick it up.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] mm: migrate: requeue destination folio on deferred split queue
  2026-03-15  0:23           ` Andrew Morton
@ 2026-03-20 11:41             ` David Hildenbrand (Arm)
  0 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-03-20 11:41 UTC (permalink / raw)
  To: Andrew Morton, SeongJae Park
  Cc: Usama Arif, npache, ziy, willy, linux-mm, matthew.brost,
	joshua.hahnjy, hannes, rakie.kim, byungchul, gourry, ying.huang,
	apopple, linux-kernel, kernel-team, richard.weiyang, stable

On 3/15/26 01:23, Andrew Morton wrote:
> On Sat, 14 Mar 2026 17:05:54 -0700 SeongJae Park <sj@kernel.org> wrote:
> 
>>  Because THPs are
>> removed from the deferred_list, THP shinker cannot split the underutilized THPs
>> in time.  As a result, users will show less free memory than before.
> 
> That'll do, thanks ;)
> 
> Pasted, added cc:stable.  It's been there since 6.12 so I don't see a
> need to rush this in, so I won't move this into mm-hotfixes - it'll go
> into mainline for 7.1-rc1 after which -stable should pick it up.

Makes sense. I guess using the partially-mapped is only a slight
problem, because we usually try to split partially-mapped before migrating.

So it's mostly about over-allocated THPs (mostly 0) not getting scanned
and split+reclaimed after they were migrated.

Under memory pressure without swap, that might create a user-visible
problem, especially when many such THPs are migrated before being
scanned for zeropages that can be reclaimed.

-- 
Cheers,

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-20 11:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260312104723.1351321-1-usama.arif@linux.dev>
     [not found] ` <20260313001630.80081-1-sj@kernel.org>
     [not found]   ` <20260312175241.01b876f3b325264f43312d79@linux-foundation.org>
2026-03-13 10:40     ` [PATCH v3] mm: migrate: requeue destination folio on deferred split queue Usama Arif
2026-03-14 22:40       ` Andrew Morton
2026-03-15  0:05         ` SeongJae Park
2026-03-15  0:23           ` Andrew Morton
2026-03-20 11:41             ` David Hildenbrand (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox