linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: John Garry <john.g.garry@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Damien Le Moal <dlemoal@kernel.org>,
	Niklas Cassel <cassel@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-block@vger.kernel.org, linux-ide@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4/4] block: simplify tag allocation policy selection
Date: Mon, 6 Jan 2025 08:35:20 +0100	[thread overview]
Message-ID: <20250106073520.GA17229@lst.de> (raw)
In-Reply-To: <d7cbbe46-ecd1-4bdc-8fe9-7df499ba9e6f@oracle.com>

On Fri, Jan 03, 2025 at 09:33:31AM +0000, John Garry wrote:
>> -	BUILD_BUG_ON(ARRAY_SIZE(alloc_policy_name) != BLK_TAG_ALLOC_MAX);
>> +	BUILD_BUG_ON(ARRAY_SIZE(hctx_flag_name) != ilog2(BLK_MQ_F_MAX));
>>   -	seq_puts(m, "alloc_policy=");
>
> Maybe it's nice to preserve this formatting, but I know that debugfs is not 
> a stable ABI...

It's not a stable API indeed, and I'd rather not keep extra code for
debugging.

>> index 72c03cbdaff4..d51eeba4da3c 100644
>> --- a/drivers/ata/sata_sil24.c
>> +++ b/drivers/ata/sata_sil24.c
>> @@ -378,7 +378,7 @@ static const struct scsi_host_template sil24_sht = {
>>   	.can_queue		= SIL24_MAX_CMDS,
>>   	.sg_tablesize		= SIL24_MAX_SGE,
>>   	.dma_boundary		= ATA_DMA_BOUNDARY,
>> -	.tag_alloc_policy	= BLK_TAG_ALLOC_FIFO,
>> +	.tag_alloc_policy	= SCSI_TAG_ALLOC_FIFO,
>
> do we actually need to set tag_alloc_policy to the default 
> (SCSI_TAG_ALLOC_FIFO)?

libata uses weird inheritance where __ATA_BASE_SHT sets default fields
that can then later be override, so this is indeed needed to set the
field back to the original default after the previous assignment changed
it.  (Did I mentioned I hate this style of programming? :))

> Could we just have
>
> struct scsi_host_template {
> 	...
> 	int tag_alloc_policy_rr:1
>
> instead of this enum?

This should probably work.  I tried to reduce the churn a bit, but
due to the change of the enum value names that didn't actually work.

>
> Or does that cause issues for the ATA SHT and descendants where it 
> overrides members? I didn't think that it would.

It'll still work fine.  It will be even less obvious, so the case
mentioned above by you will probably have to grow a comment explaining
it to preempt the cleanup brigade from removing it.


  reply	other threads:[~2025-01-06  7:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03  7:42 more BLK_MQ_F_* simplification Christoph Hellwig
2025-01-03  7:42 ` [PATCH 1/4] block: better split mq vs non-mq code in add_disk_fwnode Christoph Hellwig
2025-01-03  7:42 ` [PATCH 2/4] block: remove blk_mq_init_bitmaps Christoph Hellwig
2025-01-03  8:57   ` John Garry
2025-01-03  7:42 ` [PATCH 3/4] block: remove BLK_MQ_F_NO_SCHED Christoph Hellwig
2025-01-03  7:42 ` [PATCH 4/4] block: simplify tag allocation policy selection Christoph Hellwig
2025-01-03  9:33   ` John Garry
2025-01-06  7:35     ` Christoph Hellwig [this message]
2025-01-06  7:58       ` Christoph Hellwig
2025-01-06  8:06         ` John Garry
  -- strict thread matches above, loose matches on Subject: below --
2025-01-06  8:35 more BLK_MQ_F_* simplification v2 Christoph Hellwig
2025-01-06  8:35 ` [PATCH 4/4] block: simplify tag allocation policy selection Christoph Hellwig
2025-01-06  8:50   ` John Garry
2025-01-06  8:55     ` Christoph Hellwig
2025-01-06 10:40       ` John Garry

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=20250106073520.GA17229@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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).