All of lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: SJ Park <sj@kernel.org>, jiale yao <19888972804@163.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_idle: call folio_test_lru() after folio_get()
Date: Wed, 22 Jul 2026 17:42:49 -0700	[thread overview]
Message-ID: <20260723004250.96509-1-sj@kernel.org> (raw)
In-Reply-To: <amC7kzf4f0lRd_Gu@lucifer>

On Wed, 22 Jul 2026 13:50:05 +0100 "Lorenzo Stoakes (ARM)" <ljs@kernel.org> wrote:

> Nooooo :) this is not how you send patches.
> 
> Also you should _reply_ to review comments, not just send another patch with no
> reply. Comms is king.
> 
> Also - don't respin so quick. Wait a day.
> 
> Then send a v2, NOT in reply to anything.
> 
> Really best way is to use b4, docs at
> https://b4.docs.kernel.org/en/latest/contributor/prep.html and etc.
> 
> But you can also do something like:
> 
> git format-patch -v2 HEAD~1
> scripts/checkpatch.pl <patch filename>
> scripts/get_maintainer.pl <patch filename>
> git send-email --to="(andrew)" --cc="<list from get maintainers>" <patch filename>
> 
> 
> On Wed, Jul 22, 2026 at 07:20:20PM +0800, jiale yao wrote:
> > page_idle_get_folio() speculatively calls folio_test_lru() before
> > folio_try_get(). The folio can get freed and reallocated to a tail page
> > in the meantime. In that case, VM_BUG_ON_PGFLAGS() in
> > const_folio_flags() can be triggered. Remove the speculative call.
> >
> > This is a sibling-path bug: damon_get_folio() was copied from this
> > function with the same flawed pattern. Commit d6b8b02a27b3
> > ("mm/damon/ops-common: call folio_test_lru() after folio_get()") fixed
> > damon_get_folio(), but page_idle_get_folio() was left unfixed.

I was actually thinking I should also do this, but I was again failed at
managing my memory.  Thank you for doing this, Jiale!

> > KCSAN
> > (strict mode) confirms the data race on the folio flags:
> >
> >   BUG: KCSAN: data-race in ... / percpu_counter_add_batch
> >     page_idle_get_folio+0x7a/0x2d0
> >     page_idle_bitmap_read+0xc9/0x220
> >
> > Signed-off-by: Jiale Yao <yaojiale02@163.com>
> > Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

> 
> this should really be backported, so good to find the right commit to use as a Fixes: here.
> 
> Also then add Cc: <stable@vger.kernel.org> so it gets send for backporting.
> 
> But _please_ wait a day before sending the v2 :)
> 
> > ---
> 
> Also in the v2 put a list of changes here (will not be included in commit msg)
> with links to previous versions on lore.

Assuming all the above nice suggestions from Lorenzo are accepted,

Reviewed-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]


  reply	other threads:[~2026-07-23  0:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  9:26 [PATCH] mm/page_idle: call folio_test_lru() after folio_get() Jiale Yao
2026-07-22  9:56 ` Lorenzo Stoakes (ARM)
2026-07-22 11:20   ` jiale yao
2026-07-22 12:50     ` Lorenzo Stoakes (ARM)
2026-07-23  0:42       ` SJ Park [this message]
2026-07-23  2:29         ` jiale yao
2026-07-23  2:40       ` jiale yao
2026-07-23  0:48   ` SJ Park

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=20260723004250.96509-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=19888972804@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.