From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C69DB2820A9 for ; Thu, 23 Jul 2026 00:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784767379; cv=none; b=t6ntTvy0NhxtJMO1l7Kwx518zhBExHOaP4DftiCEMURI1L1AIIWq/gylYeSD2EQfOwjtlk5dAKWSzR8i/RMjFzytC+/uNaohZeiZ8JFznF8e781mIWJ2poozUlNNCdxR8/objOS4EUsDoLHcAask0QLw7DCTmmb+BLx/viBfJUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784767379; c=relaxed/simple; bh=yQy6XIFdz/8aiFEMR52QU/1XFAJGfihB0tvAD9Kohd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SLDxzlvzsZVXm/gpV/q9FKOGEadbAEqu9hiRX1CFMcx+h7P6rJqpOk1N9IjVHjLqYnVFpax5MkHeqEwsDGSsg1PVFtbauS/RuRTEWrMYSYW1B9XUviC0PBpDGnat5y13WeaVRw1M4tUwJedgekTztCcQ8HrVEAtRmahtFTUBkkI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mTqLo440; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mTqLo440" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 214441F000E9; Thu, 23 Jul 2026 00:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784767378; bh=X+2kLP9EImJrEMVLvA4gKSuudUGJH4mKmiOkjQNmRDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mTqLo440Dol06r7eUsxr2uCFOzX9K0M4cgRa7uukdEBjKRDQ1wLsKCtZ7f8Qq5wfr HEg+AXOec3M7KXRZxVN9SKxvtbIk0WfaR0noRnTw/eqSsPwHG5II8/naBxyoXSNp5p NGFGcBRNvWCH9UCi8+TE5LCkI6zRdsgUqzKE5nQG2SAKeKf8nWD3KyfQAtysmY0Hoj uHeWSoorIJhn0fv4a11Rkg5mZPJQ3EB+tWLgzAXQnzXblk8qtrNhYswkU1D5Et1Qth sOML6nJjjMcByq0+E0MEjNfXZQMUAoRFBGB/ms+lKBSEAcTt7IgLJePqhrPgswMW+d HB8FaUiy05MyA== From: SJ Park To: "Lorenzo Stoakes (ARM)" Cc: SJ Park , jiale yao <19888972804@163.com>, Andrew Morton , David Hildenbrand , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , 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 Message-ID: <20260723004250.96509-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 22 Jul 2026 13:50:05 +0100 "Lorenzo Stoakes (ARM)" 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 > scripts/get_maintainer.pl > git send-email --to="(andrew)" --cc="" > > > 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 > > Reviewed-by: Lorenzo Stoakes (ARM) > > this should really be backported, so good to find the right commit to use as a Fixes: here. > > Also then add Cc: 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 Thanks, SJ [...]