From: John Garry <john.g.garry@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH v2] block: Use enum for blk-mq tagset flags
Date: Fri, 3 Jan 2025 08:23:02 +0000 [thread overview]
Message-ID: <f3852e75-dff7-4cc9-b64c-01ebf1020808@oracle.com> (raw)
In-Reply-To: <20250103064427.GA27984@lst.de>
On 03/01/2025 06:44, Christoph Hellwig wrote:
> On Thu, Jan 02, 2025 at 02:44:26PM +0000, John Garry wrote:
>> Use an enum for tagset flags, so that they are automatically
>> renumbered when modified and we don't potentially leave
>> unused gaps. Some may find this neater.
>
> Just as last time around I think this is a bad idea that just creates
> more boilerplate.
Pros:
- better to not have unused gaps
- catch missing blk-mq debugfs array names
- this has been a problem in the past
Cons:
- boilerplate
A compromise could be to use some macro to evaluate the flags, like:
#define BLK_MQ_F(flag) (1 << BLK_MQ_B_##flag)
And have, for example:
.flags = BLK_MQ_F(STACKING) | BLK_MQ_F(BLOCKING);
But that will lead to churn in swapping the flag throughout the code and
maybe also obfuscate, so I highly doubt whether it is even better.
Anyway, I've made my pitch.
> I actually wrote a series before my vacation to
> drop another unused flag, remove the weirdo policy indiretion and
> add better max flag checking while removing code. Let me rebase
> that, finish writing commit log and send it out.
>
next prev parent reply other threads:[~2025-01-03 8:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 14:44 [PATCH v2] block: Use enum for blk-mq tagset flags John Garry
2025-01-03 6:44 ` Christoph Hellwig
2025-01-03 8:23 ` John Garry [this message]
2025-01-03 8:27 ` Christoph Hellwig
2025-01-03 8:38 ` John Garry
2025-01-03 15:13 ` 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=f3852e75-dff7-4cc9-b64c-01ebf1020808@oracle.com \
--to=john.g.garry@oracle.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.