From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796289158; b=IPnhION+obVOngpj6WS0uZU2+8Ymlt+DOgzO694DE1zaTMi3YXowIIODYy/z7xNkTPID 4ZdpLStQHvLFUSzHR3if/g8TRejrDiMKNWPbcgSHoYK4s12cwfQANvXg9xWg4MUirLFEm c+BwrahRfekS62BH8aV6jj+F93KjS3WFR6ezjSzbpz6AO7EIEwku50sMZmoUH/sU8kz+L wXZNFPR69TNuvXinvns7V2uoo3izwQEL1JaL/howsnfko0Yc6ghICpqNNfACb54yR0Eox fFuKWakWKJTob7oQuGoxUfCJmatnLeAi7N75fSCVXmWrwKyB36W+0rUt+tH1uPtnopg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796289158; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Content-Type:Mime-Version:Subject:From: In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References: To:X-Mailer; bh=CO9DIXJ7Ik9mh1tLxRCD1LahlfNYbdVltbQIobSV/zw=; b=f1UjllmTK13ikT2jGtOVU3LP72T0SWSFwN1xcc8kuuhLYTRAvORl0jfQW8F85O/P3nlU z0z+QVHaA7umcwZvMC1s0mob4JW+qMMDdxHJn/sHZtJMwi2yBdkvw1GGW8oIawBYzjOrl hJf5jbHJEfbzcg2J3d/7wdkbqwy0qIXBpHsU3yAQbAQgHE12kPM0zZumgnnGaEHdbeqB3 shx7lLj+u3lSjxmvbEvVJq78J7lKcaliAtufYI1mMEyAR+7kXJJXJvWqjwPgQSfQuR+Jx vvs+tYU8vrB/cvehBS5WmJbiG/D7hdU3VN4CMWI1Ur1m9Yj+qES6W0DiHLHn5dw6JYw== 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="r/vdqYNR"; arc=none smtp.remote-ip=95.215.58.179 Received: from mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 724A4606A337 for ; Thu, 3 Dec 2026 09:12:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 724A4606A337 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=r/vdqYNR X-Envelope-To: linux-ext4@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=CO9DIXJ7Ik9mh1tLxRCD1LahlfNYbdVltbQIobSV/zw=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796289155; v=1; x=1796893955; b=r/vdqYNR81sJHFVvBZVrPpDQW7Y7QU6SvPJs3nJWY7ajLeh0895eOwSqTirAi7SgzauSFVlJ xJA61NhFNUNjoqv7jYjf2OmR4+MA64c5vkcHW5uQ6tjgefRsKZ3FO4TE/lMhQNCYGnHnQw+Cev/ hf79NGFE1muMm+rBU3DdB8/w= X-Envelope-To: linux-ext4@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id ef794125d73a4e09; Thu, 03 Dec 2026 09:12:35 +0000 X-Mizu-Trace-ID: ef794125d73a4e09 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset=us-ascii X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3901.200.71.1.16\)) Subject: Re: [PATCH v2 RESEND] ext4: cancel dirty accounting for folios without buffers From: Muchun Song In-Reply-To: <20261203090009.16730-1-zhujia.zj@bytedance.com> Date: Thu, 3 Dec 2026 17:12:17 +0800 Cc: Muchun Song , Theodore Ts'o , Andreas Dilger , Baokun Li , Jan Kara , Ojaswin Mujoo , Ritesh Harjani , Zhang Yi , Zhang Yi , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <57BEB77F-5829-43A2-A325-A3B7DE613D27@linux.dev> References: <20261203090009.16730-1-zhujia.zj@bytedance.com> To: Jia Zhu X-Mailer: Apple Mail (2.3901.200.71.1.16) > On Dec 3, 2026, at 17:00, Jia Zhu wrote: >=20 > Since commit cc5095747edf ("ext4: don't BUG if someone dirty pages > without asking ext4 first"), mpage_prepare_extent_to_map() handles = dirty > folios without buffer heads by warning, clearing PG_dirty, and = skipping > them. ext4 cannot write these folios because there are no buffer heads = to > map and submit. >=20 > That recovery leaves dirty accounting behind: folio_clear_dirty() = clears > PG_dirty but does not undo the accounting charged when the folio was > dirtied. We have seen this in production as Dirty/nr_dirty staying = high > while Writeback/nr_writeback and device write IO stayed near zero, = with > many writer tasks blocked in balance_dirty_pages() throttling. Thus = the > warning-and-skip recovery can still become a dirty-throttle DoS. >=20 > Use folio_cancel_dirty() so dropping PG_dirty also cancels the dirty > accounting. Then cycle the folio through writeback state so the = generic > writeback helpers update the xarray DIRTY/TOWRITE tags. >=20 > Fixes: cc5095747edf ("ext4: don't BUG if someone dirty pages without = asking ext4 first") > Cc: stable@vger.kernel.org > Suggested-by: Zhang Yi > Reviewed-by: Jan Kara > Reviewed-by: Zhang Yi > Signed-off-by: Jia Zhu Acked-by: Muchun Song (ByteDance) Thanks.