public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	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: Wed, 30 Nov 2022 14:29:27 -0800	[thread overview]
Message-ID: <6c41f85b-7add-60d7-e131-71c3cfae80d0@acm.org> (raw)
In-Reply-To: <32feb681-e858-1a0c-b91d-3f0d85615a6d@opensource.wdc.com>

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.

Thanks,

Bart.


  reply	other threads:[~2022-11-30 22:29 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 [this message]
2022-12-01  0:39       ` Damien Le Moal

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=6c41f85b-7add-60d7-e131-71c3cfae80d0@acm.org \
    --to=bvanassche@acm.org \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --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