From: Tejun Heo <tj@kernel.org>
To: Tao Cui <cuitao@kylinos.cn>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH] blk-cgroup-rwstat: add missing DISCARD counter in blkg_rwstat_total()
Date: Mon, 18 May 2026 09:19:07 -1000 [thread overview]
Message-ID: <agtmKyx4GqRQrftf@slm.duckdns.org> (raw)
In-Reply-To: <20260516044752.446995-1-cuitao@kylinos.cn>
On Sat, May 16, 2026 at 12:47:52PM +0800, Tao Cui wrote:
> Since commit 636620b66d5d ("blkcg: Track DISCARD statistics and output
> them in cgroup io.stat"), blkg_rwstat_add() routes discard IOs into
> BLKG_RWSTAT_DISCARD, but blkg_rwstat_total() still only sums READ and
> WRITE. This makes the total inconsistent with the per-type counters
> whenever discard IOs are present.
>
> On mixed read/write/discard workloads, the total undercounts the
> actual IO activity. If only discard requests are queued, the total
> returns 0 outright. In BFQ this causes avg_queue_size to be
> underestimated and the group to be incorrectly marked empty.
>
> The affected BFQ code paths are all gated by CONFIG_BFQ_CGROUP_DEBUG
> and used only for statistics display (bfq.sectors, bfq.avg_queue_size,
> bfq.empty_time). No scheduling decisions depend on these values.
I don't think including discard in total io amount is an improvement. This
will throw off a lot of people.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-05-18 19:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 4:47 [PATCH] blk-cgroup-rwstat: add missing DISCARD counter in blkg_rwstat_total() Tao Cui
2026-05-18 19:19 ` Tejun Heo [this message]
2026-05-19 1:08 ` Tao Cui
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=agtmKyx4GqRQrftf@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=cuitao@kylinos.cn \
--cc=linux-block@vger.kernel.org \
/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