[PATCH] move the comment.
From: Zi Yan
Date: Wed Apr 01 2026 - 18:52:43 EST
Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
mm/huge_memory.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ac6d823e351ff..970e077019b75 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -4567,15 +4567,18 @@ static unsigned long deferred_split_scan(struct shr=
inker *shrink,
}
folio_unlock(folio);
next:
+ /*
+ * If thp_underused() returns false, or if split_folio()
+ * succeeds, or if split_folio() fails in the case it was
+ * underused, then consider it used and don't add it back to
+ * split_queue.
+ */
if (did_split || !folio_test_partially_mapped(folio))
continue;
requeue:
/*
- * Add back partially mapped folios, or underused folios
- * that we could not lock this round. If thp_underused()
- * returns false, or if split_folio() succeeds, or if
- * split_folio() fails in the case it was underused, then
- * consider it used and don't add it back to split_queue.
+ * Add back partially mapped folios, or underused folios that
+ * we could not lock this round.
*/
fqueue =3D folio_split_queue_lock_irqsave(folio, &flags);
if (list_empty(&folio->_deferred_list)) {
--=20
2.53.0
>
> Otherwise, LGTM.
>
> Acked-by: Zi Yan <ziy@xxxxxxxxxx>
>
>> fqueue =3D folio_split_queue_lock_irqsave(folio, &flags);
>> if (list_empty(&folio->_deferred_list)) {
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 05cb408846f2..8a64291ab5b4 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -1385,6 +1385,15 @@ static int migrate_folio_move(free_folio_t put_ne=
w_folio, unsigned long private,
>> if (rc)
>> goto out;
>>
>> + /*
>> + * Requeue the destination folio on the deferred split queue if
>> + * the source was on the queue. The source is unqueued in
>> + * __folio_migrate_mapping(), so we recorded the state from
>> + * before move_to_new_folio().
>> + */
>> + if (src_deferred_split)
>> + deferred_split_folio(dst, src_partially_mapped);
>> +
>> /*
>> * When successful, push dst to LRU immediately: so that if it
>> * turns out to be an mlocked page, remove_migration_ptes() will
>> @@ -1401,15 +1410,6 @@ static int migrate_folio_move(free_folio_t put_ne=
w_folio, unsigned long private,
>> if (old_page_state & PAGE_WAS_MAPPED)
>> remove_migration_ptes(src, dst, 0);
>>
>> - /*
>> - * Requeue the destination folio on the deferred split queue if
>> - * the source was on the queue. The source is unqueued in
>> - * __folio_migrate_mapping(), so we recorded the state from
>> - * before move_to_new_folio().
>> - */
>> - if (src_deferred_split)
>> - deferred_split_folio(dst, src_partially_mapped);
>> -
>> out_unlock_both:
>> folio_unlock(dst);
>> folio_set_owner_migrate_reason(dst, reason);
>> --=20
>> 2.49.0
>
>
> Best Regards,
> Yan, Zi
Best Regards,
Yan, Zi