From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.112 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796224704; b=rA2NZoclC3wjNiwgmzvnLpOHp5idlfMhCIoX36eliTET+uXVNgIBRa1W75DxI9SOErwb 2fzWzHKLwVLA/R0sdMLBNrv42/TlndQ7zQ+pCLHtYtiLwj+sP55o/BWxk2KoudEPhOrkJ yPLVaneuHoScX/PUo9bQeTptM5zdiDShctHJizFbxDTWTTu8uEObZxY33W+xky9UR+Zcz TmXvZni/rX63xvpSEAIkOBrD3wywdDM7PKIZKn5Gvg30HhPHW9i47mRJTlPoHwA09C3kp D0megUGiqAtOYMQkI0e1w4UjU0xlekc/DB3e3I6VQPkkKW5Y8TCrybg9IFWT8p3N8Cw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796224704; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=OIzYVyu3fT38/MS4wgkLZCv6NV1TAVDf1zY0S3bCfO8=; b=tg4yeQV7EvpZT7FkH5PtuR2vSRqJdgGqPl/lrS8KFw0yb5Z86oUvMORIsJOfH89ffRig 1IQVuwwVDv8pIKlDTSCuGLfyTjrCnSZmb3OXd6aj+DYiDHG3qcfAVcK4VuMjE43k/OQn0 GjtH57yYVmrr5HWambRS4oiZAQBJntlFc0qXR1TjYY85AM4Obccp2Gz1+lNShftZo7M2q laW43NRqKupfZZVlrttTqxoJBsmzzQ0QFApI8Dy/chKXeL7uITi/7RewHctQWnsq4vynr AfCW5ieoK48d45cipxaD11fMErpUW8UfWzuy7B85d+FPQR2elR0I+WYaWy3Pg+I2qzA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=IF4AVc0t; arc=none smtp.remote-ip=91.218.175.112 Received: from mta0.migadu.com (out-112.mta0.migadu.com [91.218.175.112]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3A41606A32D for ; Wed, 2 Dec 2026 15:18:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3A41606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=IF4AVc0t X-Envelope-To: linux-fsdevel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=TaLHwD897dOPCUI1BvjYSSJChAIlq+geNDN9D6E6VSs=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796224701; v=1; x=1796829501; b=IF4AVc0tse2CISZY3OcsVqg6dGxE01NAhl97Xkjq5EcBp9t+Ys/zZOS/9RVF4ndWABpdMWkD U7I9TAHMa4BladgkG4/IKeQGOOL26fVya3CHafZaATyr/FRVU79p6/GXtEnGKHyVlQaQTQaSYZq HeUIh4IqDmSRbbQFk31UFIXQ= X-Envelope-To: linux-fsdevel@vger.kernel.org Received: by mta10.migadu.com with ESMTPS id a092f3998d600fee; Wed, 02 Dec 2026 15:18:20 +0000 X-Mizu-Trace-ID: a092f3998d600fee X-Migadu-Flow: FLOW_OUT From: Usama Arif To: "David Hildenbrand (Arm)" Cc: Usama Arif , Andrew Morton , willy@infradead.org, jack@suse.cz, axboe@kernel.dk, Christoph Hellwig , hannes@cmpxchg.org, jlayton@kernel.org, brauner@kernel.org, tz2294@columbia.edu, ritesh.list@gmail.com, chentaotao@didiglobal.com, ziy@nvidia.com, bigeasy@linutronix.de, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, mhocko@suse.com, apopple@nvidia.com, byungchul@sk.com, gourry@gourry.net, joshua.hahnjy@gmail.com, matthew.brost@intel.com, ying.huang@linux.alibaba.com, clrkwllms@kernel.org, rostedt@goodmis.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-rt-devel@lists.linux.dev, kas@kernel.org, riel@surriel.com, shakeel.butt@linux.dev, kernel-team@meta.com, stable@vger.kernel.org Subject: Re: [PATCH 1/4] mm/migrate: preserve PG_dropbehind across folio migration Date: Wed, 2 Dec 2026 07:18:12 -0800 Message-ID: <20261202151813.167220-1-usama.arif@linux.dev> X-Mailer: git-send-email 2.53.1 In-Reply-To: <3f646827-97e8-4b18-93cb-901c57158560@kernel.org> References: X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 2 Dec 2026 16:08:05 +0100 "David Hildenbrand (Arm)" wrote: > On 12/2/26 15:24, Usama Arif wrote: > > Migration moves PG_dirty to the new folio but not PG_dropbehind, so a > > migrated dirty dropbehind folio is cleaned without decrementing > > WB_DONTCACHE_DIRTY. The counter leaks, and every later RWF_DONTCACHE > > kick asks the flusher for that many more pages. Copy the flag along with > > PG_dirty, before the new folio becomes visible. > > > > With RWF_DONTCACHE writes and compaction running for five minutes, 1313 > > to 1709 pages leaked, all of them migrated. > > > > Fixes: 88d6f128d06d ("mm: track DONTCACHE dirty pages per bdi_writeback") > > Cc: stable@vger.kernel.org > > Signed-off-by: Usama Arif > > --- > > mm/migrate.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/mm/migrate.c b/mm/migrate.c > > index 96b66a272379f9..81a8e46778610f 100644 > > --- a/mm/migrate.c > > +++ b/mm/migrate.c > > @@ -663,6 +663,9 @@ static int __folio_migrate_mapping(struct address_space *mapping, > > folio_clear_dirty(folio); > > folio_set_dirty(newfolio); > > } > > + /* WB_DONTCACHE_DIRTY counts pages that are both dirty and dropbehind */ > > + if (folio_test_dropbehind(folio)) > > + folio_set_dropbehind(newfolio); > > I think I assigned Jan a Sashiko report about this yesterday :) > > Reviewed-by: David Hildenbrand (Arm) > > I assume I can pick this independent of the other ones (this through my tree, > the other stuff through Andrews tree)? Thanks for the review! Yes, the 3 fixes are independent of each other. They should go in before patch 4 though, as patch 4 makes it more likely to hit these bugs. > > -- > Cheers, > > David >