public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Bart Van Assche <bvanassche@acm.org>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Avri Altman <avri.altman@wdc.com>, Ming Lei <ming.lei@redhat.com>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: Re: [PATCH v2 8/8] null_blk: Support configuring the maximum segment size
Date: Thu, 1 Dec 2022 09:39:10 +0900	[thread overview]
Message-ID: <687161b4-3e92-9fbf-c0a6-e8dceee3d250@opensource.wdc.com> (raw)
In-Reply-To: <6c41f85b-7add-60d7-e131-71c3cfae80d0@acm.org>

On 12/1/22 07:29, Bart Van Assche wrote:
> On 11/23/22 17:40, Damien Le Moal wrote:
>> On 11/24/22 05:57, Bart Van Assche wrote:
>>> +static unsigned int g_max_segment_size = 1UL << 31;
>>
>> 1UL is unsigned long be this var is unsigned int. Why not simply use
>> UINT_MAX here ? You prefer the 2GB value ? If yes, then may be at least
>> change that to "1U << 31", no ?
>>
>> [ ... ]
>>> @@ -2106,6 +2119,7 @@ static int null_add_dev(struct nullb_device *dev)
>>>   	dev->max_sectors = min_t(unsigned int, dev->max_sectors,
>>>   				 BLK_DEF_MAX_SECTORS);
>>>   	blk_queue_max_hw_sectors(nullb->q, dev->max_sectors);
>>> +	blk_queue_max_segment_size(nullb->q, dev->max_segment_size);
>>
>> Should we keep the ability to use the kernel default value as the default
>> here ?
>> E.g.
>>
>> 	if (dev->max_segment_size)
>> 		blk_queue_max_segment_size(nullb->q,
>> 				dev->max_segment_size);
>>
>> If yes, then g_max_segment_size initial value should be 0, meaning "kernel
>> default".
> 
> Hi Damien,
> 
> How about changing the default value for g_max_segment_size from
> 1UL << 31 into BLK_MAX_SEGMENT_SIZE? That will simplify the code and 
> also prevents that this patch changes the behavior of the null_blk 
> driver if g_max_segment_size is not modified by the user.

Sounds good to me.

> 
> Thanks,
> 
> Bart.
> 

-- 
Damien Le Moal
Western Digital Research


      reply	other threads:[~2022-12-01  0:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 20:57 [PATCH v2 0/8] Add support for segments smaller than one page Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 1/8] block: Introduce CONFIG_BLK_SUB_PAGE_SEGMENTS and QUEUE_FLAG_SUB_PAGE_SEGMENTS Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 2/8] block: Support configuring limits below the page size Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 3/8] block: Support submitting passthrough requests with small segments Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 4/8] block: Add support for filesystem requests and " Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 5/8] block: Add support for small segments in blk_rq_map_user_iov() Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 6/8] scsi: core: Set the SUB_PAGE_SEGMENTS request queue flag Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 7/8] scsi_debug: Support configuring the maximum segment size Bart Van Assche
2022-11-25 17:34   ` Douglas Gilbert
2022-11-30 22:30     ` Bart Van Assche
2022-11-23 20:57 ` [PATCH v2 8/8] null_blk: " Bart Van Assche
2022-11-24  1:40   ` Damien Le Moal
2022-11-30 22:29     ` Bart Van Assche
2022-12-01  0:39       ` Damien Le Moal [this message]

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=687161b4-3e92-9fbf-c0a6-e8dceee3d250@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ming.lei@redhat.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