From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, hch@lst.de,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] block: enable passthrough command statistics
Date: Thu, 3 Oct 2024 15:00:53 +0200 [thread overview]
Message-ID: <20241003130053.GE17031@lst.de> (raw)
In-Reply-To: <20241002210744.72321-1-kbusch@meta.com>
On Wed, Oct 02, 2024 at 02:07:44PM -0700, Keith Busch wrote:
> + accounting of the disk. Set to 0 to disable all stats. Set to 1
> + to enable block IO stats. Set to 2 to enable passthrough stats
> + in addition to block IO.
Jens' reply suggest he likes this interface, but I have to say I
already hated it with a passion for the merges - overloading a
previously boolean file with a numberic value is not exactly an
intuitive interface. Is a new sysfs file for this really a problem?
> + if (!bio)
> + return false;
> + if (!bio->bi_bdev)
> + return false;
> + if (blk_rq_bytes(req) & (bdev_logical_block_size(bio->bi_bdev) - 1))
> + return false;
I understand why all these conditions are there, because basically
they'd break the current code to collect stats. But I think this needs
a comment explaining why they are there, and why the statistics are
still useful without the requests matching them.
> + lim = queue_limits_start_update(disk->queue);
> + if (!ios)
> + lim.features &= ~(BLK_FEAT_IO_STAT | BLK_FEAT_PASSTHROUGH_STAT);
> + else if (ios == 2)
> + lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_PASSTHROUGH_STAT;
> + else if (ios == 1) {
> + lim.features |= BLK_FEAT_IO_STAT;
> + lim.features &= ~BLK_FEAT_PASSTHROUGH_STAT;
BLK_FEAT_IO_STAT is in ->features because drivers need to opt into it,
but BLK_FEAT_PASSTHROUGH_STAT is purely a flag triggered by sysfs and
should go into ->flags.
next prev parent reply other threads:[~2024-10-03 13:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 21:07 [PATCH] block: enable passthrough command statistics Keith Busch
2024-10-03 1:30 ` Jens Axboe
2024-10-03 13:00 ` Christoph Hellwig [this message]
2024-10-03 13:20 ` Jens Axboe
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=20241003130053.GE17031@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--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