From: Muchun Song <muchun.song@linux.dev>
To: Jia Zhu <zhujia.zj@bytedance.com>
Cc: Muchun Song <muchun.song@linux.dev>,
Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Baokun Li <libaokun@linux.alibaba.com>, Jan Kara <jack@suse.cz>,
Ojaswin Mujoo <ojaswin@linux.ibm.com>,
Ritesh Harjani <ritesh.list@gmail.com>,
Zhang Yi <yi.zhang@huawei.com>, Zhang Yi <yizhang089@gmail.com>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] ext4: cancel dirty accounting for folios without buffers
Date: Thu, 3 Dec 2026 17:12:17 +0800 [thread overview]
Message-ID: <57BEB77F-5829-43A2-A325-A3B7DE613D27@linux.dev> (raw)
In-Reply-To: <20261203090009.16730-1-zhujia.zj@bytedance.com>
> On Dec 3, 2026, at 17:00, Jia Zhu <zhujia.zj@bytedance.com> wrote:
>
> 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.
>
> 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.
>
> 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.
>
> Fixes: cc5095747edf ("ext4: don't BUG if someone dirty pages without asking ext4 first")
> Cc: stable@vger.kernel.org
> Suggested-by: Zhang Yi <yizhang089@gmail.com>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
> Signed-off-by: Jia Zhu <zhujia.zj@bytedance.com>
Acked-by: Muchun Song (ByteDance) <muchun.song@linux.dev>
Thanks.
prev parent reply other threads:[~2026-12-03 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 9:00 [PATCH v2 RESEND] ext4: cancel dirty accounting for folios without buffers Jia Zhu
2026-12-03 9:11 ` sashiko-bot
2026-12-03 9:12 ` Muchun Song [this message]
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=57BEB77F-5829-43A2-A325-A3B7DE613D27@linux.dev \
--to=muchun.song@linux.dev \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
--cc=yizhang089@gmail.com \
--cc=zhujia.zj@bytedance.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox