From: Christoph Hellwig <hch@infradead.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: Christoph Hellwig <hch@infradead.org>,
axboe@kernel.dk, xni@redhat.com, agk@redhat.com,
snitzer@kernel.org, mpatocka@redhat.com, song@kernel.org,
viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
nadav.amit@gmail.com, ubizjak@gmail.com, cl@linux.com,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
dm-devel@lists.linux.dev, linux-raid@vger.kernel.org,
yi.zhang@huawei.com, yangerkun@huawei.com,
johnny.chenyi@huawei.com, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH v2 1/5] block: cleanup and export bdev IO inflight APIs
Date: Mon, 21 Apr 2025 23:11:51 -0700 [thread overview]
Message-ID: <aAczJzofvwrCUUNa@infradead.org> (raw)
In-Reply-To: <f01cb2d7-d69c-1565-d3e4-09c4b70856f6@huaweicloud.com>
On Mon, Apr 21, 2025 at 09:13:57PM +0800, Yu Kuai wrote:
> > I'm not sure why this is needed or related, or even what additional
> > distinction is added here.
>
> Because for rq-based device, there are two different stage,
> blk_account_io_start() while allocating new rq, and
> blk_mq_start_request() while issuing the rq to driver.
>
> When will we think the reqeust is inflight? For iostat, my anser is the
> former one, because rq->start_time_ns is set here as well. And noted in
> iostats api diskstats_show(/proc/diskstats) and part_stat_show
> (/sys/block/sda/stat), inflight is get by part_in_flight, which is
> different from disk sysfs api(/sys/block/sda/inflight).
Trying to express this in a not very obvious function name isn't
going to work very well. Documenting your findings in comments is
much better.
> >
> > I'd just change this helper to call blk_mq_count_in_driver_rw for
> > blk-mq devices and remove the conditional from the sysfs code instead.
> > That gives us a much more robust and easier to understand API.
>
> Ok, and another separate patch, right?
Yes.
next prev parent reply other threads:[~2025-04-22 6:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 1:09 [PATCH v2 0/5] md: fix is_mddev_idle() Yu Kuai
2025-04-18 1:09 ` [PATCH v2 1/5] block: cleanup and export bdev IO inflight APIs Yu Kuai
2025-04-21 11:59 ` Christoph Hellwig
2025-04-21 13:13 ` Yu Kuai
2025-04-22 6:11 ` Christoph Hellwig [this message]
2025-04-18 1:09 ` [PATCH v2 2/5] md: record dm-raid gendisk in mddev Yu Kuai
2025-04-22 6:00 ` Xiao Ni
2025-04-18 1:09 ` [PATCH v2 3/5] md: add a new api sync_io_depth Yu Kuai
2025-04-22 6:15 ` Xiao Ni
2025-04-18 1:09 ` [PATCH v2 4/5] md: fix is_mddev_idle() Yu Kuai
2025-04-19 1:42 ` Su Yue
2025-04-19 2:00 ` Yu Kuai
2025-04-19 5:03 ` Su Yue
2025-04-22 6:35 ` Xiao Ni
2025-04-27 1:37 ` Yu Kuai
2025-04-27 2:45 ` Xiao Ni
2025-04-18 1:09 ` [PATCH v2 5/5] md: cleanup accounting for issued sync IO Yu Kuai
2025-04-22 6:36 ` Xiao Ni
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=aAczJzofvwrCUUNa@infradead.org \
--to=hch@infradead.org \
--cc=agk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cl@linux.com \
--cc=dm-devel@lists.linux.dev \
--cc=johnny.chenyi@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=snitzer@kernel.org \
--cc=song@kernel.org \
--cc=ubizjak@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=xni@redhat.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.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;
as well as URLs for NNTP newsgroup(s).