linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Usama Arif <usama.arif@linux.dev>
To: Matthew Wilcox <willy@infradead.org>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	npache@redhat.com, ziy@nvidia.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 19:19:38 +0300	[thread overview]
Message-ID: <bdeb9147-0fe0-42a5-944c-4c2cfffd85d8@linux.dev> (raw)
In-Reply-To: <aar740E8K7SOy1qJ@casper.infradead.org>



On 06/03/2026 16:08, Matthew Wilcox wrote:
> On Fri, Mar 06, 2026 at 05:12:38PM +0300, Usama Arif wrote:
>> +       /*
>> +        * Record whether the source folio is on the deferred split queue
>> +        * before move_to_new_folio(), which unqueues it via
>> +        * __folio_migrate_mapping().
>> +        */
>> +       if (folio_test_large(src) && folio_test_large_rmappable(src) &&
>> +           !data_race(list_empty(&src->_deferred_list)))
> 
> Why do you need data_race() here?  list_empty() contains a READ_ONCE()
> so shouldn't be necessary?

Ah mainly because we dont acquire split_queue_lock before accessing,
similar to what we do in folio_unqueue_deferred_split().

> 
>> +               old_page_state |= PAGE_WAS_ON_DEFERRED_SPLIT;
> 
> You've done a great job of the naming.  So much so that the comment
> seems entirely unnecessary?
> 
>> +       /*
>> +        * 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 record and check the state
>> +        * from before move_to_new_folio().
>> +        */
>> +       if (old_page_state & PAGE_WAS_ON_DEFERRED_SPLIT)
>> +               deferred_split_folio(dst, false);
> 
> Again, I'm not sure the comment says anything that the code doesn't?

Yeah there is a much simpler version in reply to Zi's review in [1].
I found the whole migrate_folio_move() function quite verbose already,
was keeping up with the theme of that function lol. I will see if I can
cut down on the comment in [1] as well. Thanks!

[1] https://lore.kernel.org/all/28e48b47-f215-4e4a-b55a-01dbf293ff35@linux.dev/



  reply	other threads:[~2026-03-06 16:19 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)
2026-03-06 16:26         ` Zi Yan
2026-03-06 16:08     ` Matthew Wilcox
2026-03-06 16:19       ` Usama Arif [this message]
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=bdeb9147-0fe0-42a5-944c-4c2cfffd85d8@linux.dev \
    --to=usama.arif@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=byungchul@sk.com \
    --cc=david@kernel.org \
    --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=willy@infradead.org \
    --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