linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Bart Van Assche <bvanassche@acm.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [RFC PATCH 01/21] block: add and use init tagset helper
Date: Thu, 6 Oct 2022 18:13:29 +0000	[thread overview]
Message-ID: <7e9ce6b2-70c8-cf85-95ab-de09090db64d@nvidia.com> (raw)
In-Reply-To: <a7e4fe12-64f2-3164-d675-26310ac07c9e@nvidia.com>

On 10/5/22 10:22, Chaitanya Kulkarni wrote:
> On 10/5/22 09:54, Bart Van Assche wrote:
>> On 10/5/22 02:47, Ulf Hansson wrote:
>>> On Wed, 5 Oct 2022 at 07:11, Damien Le Moal
>>> <damien.lemoal@opensource.wdc.com> wrote:
>>>> On 10/5/22 12:22, Chaitanya Kulkarni wrote:
>>>>> +void blk_mq_init_tag_set(struct blk_mq_tag_set *set,
>>>>> +             const struct blk_mq_ops *ops, unsigned int nr_hw_queues,
>>>>> +             unsigned int queue_depth, unsigned int cmd_size, int
>>>>> numa_node,
>>>>> +             unsigned int timeout, unsigned int flags, void
>>>>> *driver_data)
>>>>
>>>> That is an awful lot of arguments... I would be tempted to say pack all
>>>> these into a struct but then that would kind of negate this patchset
>>>> goal.
>>>> Using a function with that many arguments will be error prone, and
>>>> hard to
>>>> review... Not a fan.
>>>
>>> I completely agree.
>>>
>>> But there is also another problem going down this route. If/when we
>>> realize that there is another parameter needed in the blk_mq_tag_set.
>>> Today that's quite easy to add (assuming the parameter can be
>>> optional), without changing the blk_mq_init_tag_set() interface.
>>
>> Hi Chaitanya,
>>
>> Please consider to drop the entire patch series. In addition to the
>> disadvantages mentioned above I'd like to mention the following
>> disadvantages:
>> * Replacing named member assignments with positional arguments in a
>>     function call makes code harder to read and harder to verify.
>> * This patch series makes tree-wide changes without improving the code
>>     in a substantial way.
>>
>> Thanks,
>>
>> Bart.
>>
> 
> Thanks for the feedback, will drop it.
> 
> -ck
> 

Actually I take that back.

The problems listed here are:-
* Long argument list, hard to verify (Damien,Bart):-
   solution is to make smaller like other function bio_alloc_bioset()
   blk_next_bio() present in the tree.

* Not future proof if tag_set gets new member that needs to be
   initialized increasing the argument list of the new API. (Ulf):-
   solution is to only use common and mandatory members which are
   necessary as new API args, so if new members gets added it will not
   affect the API, that also trims down the argument list.

I will trim down the argument list with the most common arguments
and keep it to max 4-5 mandatory arguments identical to what we
have done this for blk_next_bio() and bio_alloc_bioset() [1]
where mandatory arguments are part of the initialization API
than repeating the code all the in the tree, that creates
maintenance work of treewide patches.

Also, instead of doing tree wide change in series I'll start small
and gradually add more patches over time.

This definitely adds a more value to the code where code is not
repeated for mandatory arguments, which are way less than 9.

-ck

[1]

8c16567d867ed bio_alloc_bioset() 5 arguments.
0a3140ea0fae3 blk_next_bio() 5 arguments.


  reply	other threads:[~2022-10-06 18:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05  3:22 [RFC PATCH 00/21] block: add and use init tagset helper Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 01/21] " Chaitanya Kulkarni
2022-10-05  5:11   ` Damien Le Moal
2022-10-05  9:47     ` Ulf Hansson
2022-10-05 16:54       ` Bart Van Assche
2022-10-05 17:22         ` Chaitanya Kulkarni
2022-10-06 18:13           ` Chaitanya Kulkarni [this message]
2022-10-06 18:40             ` Bart Van Assche
2022-10-07 19:40               ` Jens Axboe
2022-10-05  3:22 ` [RFC PATCH 02/21] loop: use lib tagset init helper Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 03/21] nbd: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 04/21] rnbd: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 05/21] bsg-lib: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 06/21] rnbd-clt: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 07/21] virtio-blk: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 08/21] scsi: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 09/21] block: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 10/21] amiflop: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 11/21] floppy: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 12/21] mtip32xx: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 13/21] z3ram: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 14/21] scm_blk: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 15/21] ubi: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 16/21] mmc: core: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 17/21] dasd: " Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 18/21] nvme-core: use lib tagset init helper for I/O q Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 19/21] nvme-core: use lib tagset init helper for adminq Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 20/21] nvme-apple: use lib tagset init helper Chaitanya Kulkarni
2022-10-05  3:22 ` [RFC PATCH 21/21] nvme-pci: " Chaitanya Kulkarni
2022-10-07 18:26 ` [RFC PATCH 00/21] block: add and use init tagset helper Luis Chamberlain
2022-10-10  7:55   ` Christoph Hellwig

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=7e9ce6b2-70c8-cf85-95ab-de09090db64d@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ulf.hansson@linaro.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;
as well as URLs for NNTP newsgroup(s).