From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796289082; b=GK8CL8/H9+MB7zg+u1e6atIaZHDjnbBOzGr98G5iSsNLvh98E3UW1yVIMt1QBATLqG/j EQOkwEn+xKtgKOdO0ZAkXqs35pjE3uRSHsTI1EAgJaSvaIOzU3o/SuWivLY916t6y/QOs KLHdO+5FM8La4qOn7NTNtMMndXHt8ooO2Qc8YKM5Z077XOdjEDRwN/fg3LEsTABToed+u A4sYV23W+NPqswM2jmPchHNHLD1bMbCvN3f8M3fUWc1IJbBCp3J8QqKDtW0EG5CqxFtM8 OkjSOe1yakoD8rpwSI2o4BN3ySAm7x2q5y1WiJP/z2SoiwJzvWknUJAsXwKZFagrK6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796289082; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Lx0QsgdEFG7N3/Fz4Q0tmzjQKC8BfCdY3FdlkIHuk0I=; b=qQHqsle397yDj0N2DbOeb7ji47PCLpcEp2dG08y2EfZzW+2VBtMypGNULcYr53On84Ce nPdYpjiVHj+3Y4RtGHhl4tmr016CXTpGx66flQ7c2vW4Br/Rhnzykn03Bu2YP7Gw1EDB7 bGwJoYO+m0aOmEps7quKKCB8pTmLqP3Ecmp5EhLeIK2EaaO1df+jxvbD3TQF8TPT7f8pu KuWZdne1Zzo4LLOW3mjC7UZ2r8RiMk8NEZSli7F+KX+zRpN1CcnpLVMvlxNJwntBBVYcL 76n7yCPIznRzTblZHNkSVyVnaqp1k7adrDW6/k/2HLI5ngFft7Q+uZYLip/Etv0TbRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VPj7lU+0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDB94606A322 for ; Thu, 3 Dec 2026 09:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VPj7lU+0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E58B51F00893; Thu, 3 Dec 2026 09:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796289082; bh=Lx0QsgdEFG7N3/Fz4Q0tmzjQKC8BfCdY3FdlkIHuk0I=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=VPj7lU+0fXWFOzQLYGkKCl5BCRJHM/+fybBz4Qk7+Z5WUVj1I8Hl3yE5YlOkbFYiE CLMUcE7IzIpHRnqGaOHuk75VFcpd9pOWJ0wGgsle9m19v0qXOV6+AfIro0l9GhOLZO BTWPdetb1eg3LjH3PHWlfYRKfFaYxfvIrkg33mwviWekZxcY9tfZqiO7hbwFj2wFCt agOXsiiGr9luoGkLsC6PoT1kcTddbyKYLRYrUTiO/x+q2oas6GlB2Ik9/L0PI/8SQl yrcI90Cu4E3gpZJWbJBFkeb1VgIrFlSr4A9yNe0Mg+gozq4We6yREhnfk5UVtdKkGF IvxPusNP+TUTA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 RESEND] ext4: cancel dirty accounting for folios without buffers Reply-To: sashiko-reviews@lists.linux.dev To: "Jia Zhu" Cc: linux-ext4@vger.kernel.org, tytso@mit.edu In-Reply-To: <20261203090009.16730-1-zhujia.zj@bytedance.com> References: <20261203090009.16730-1-zhujia.zj@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 09:11:19 +0000 X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > 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 aski= ng ext4 first") > Cc: stable@vger.kernel.org > Suggested-by: Zhang Yi > Reviewed-by: Jan Kara > Reviewed-by: Zhang Yi > Signed-off-by: Jia Zhu Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203090009.1673= 0-1-zhujia.zj@bytedance.com?part=3D1