All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Sandeep Dhavale <dhavale@google.com>,
	Juan Yescas <jyescas@google.com>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Ming Lei <ming.lei@redhat.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>
Subject: Re: [PATCH v6 8/8] null_blk: Support configuring the maximum segment size
Date: Tue, 13 Jun 2023 15:47:00 +0900	[thread overview]
Message-ID: <baffcda4-4a9d-6631-a5bf-b36f59f82bae@kernel.org> (raw)
In-Reply-To: <2ec5270c-a913-44cf-3a45-0713e6c58224@acm.org>

On 6/13/23 09:44, Bart Van Assche wrote:
> On 6/12/23 15:17, Damien Le Moal wrote:
>> On 6/13/23 05:33, Bart Van Assche wrote:
>>> @@ -1283,7 +1293,8 @@ static int null_handle_rq(struct nullb_cmd *cmd)
>>>   
>>>   	spin_lock_irq(&nullb->lock);
>>>   	rq_for_each_segment(bvec, rq, iter) {
>>> -		len = bvec.bv_len;
>>> +		len = min(bvec.bv_len, nullb->dev->max_segment_size);
>>> +		bvec.bv_len = len;
>>
>> I am still confused by this change... Why is it necessary ? If max_segment_size
>> is set correctly, how can we ever get a BIO with a bvec length exceeding that
>> maximum ? If that is the case, aren't we missing a bio_split() somewhere ?
> 
> Hi Damien,
> 
> bio_split() enforces the max_sectors limit but not the max_segment_size 
> limit. __blk_rq_map_sg() enforces the max_segment_size limit. null_blk 
> does not call __blk_rq_map_sg(). Hence the above code to enforce the 
> max_segment_size limit.

OK. That is where I was confused :)
Thanks !

> 
> Thanks,
> 
> Bart.
> 

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2023-06-13  6:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 20:33 [PATCH v6 0/8] Support limits below the page size Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 1/8] block: Use pr_info() instead of printk(KERN_INFO ...) Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 2/8] block: Prepare for supporting sub-page limits Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 3/8] block: Support configuring limits below the page size Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 4/8] block: Make sub_page_limit_queues available in debugfs Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 5/8] block: Support submitting passthrough requests with small segments Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 6/8] block: Add support for filesystem requests and " Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 7/8] scsi_debug: Support configuring the maximum segment size Bart Van Assche
2023-06-12 20:33 ` [PATCH v6 8/8] null_blk: " Bart Van Assche
2023-06-12 22:17   ` Damien Le Moal
2023-06-13  0:44     ` Bart Van Assche
2023-06-13  6:47       ` Damien Le Moal [this message]
2023-06-13  6:52       ` Christoph Hellwig
2023-06-15  2:01 ` [PATCH v6 0/8] Support limits below the page size Bart Van Assche
2023-06-15  2:22 ` Jens Axboe
2023-06-15  4:15   ` Christoph Hellwig
2023-06-15 13:55     ` Bart Van Assche
2023-06-16  7:02       ` Christoph Hellwig
2023-06-16 20:26         ` Bart Van Assche
2023-06-16 21:48           ` Jens Axboe
2023-06-16 22:28             ` Bart Van Assche
2023-08-04 23:11         ` Juan Yescas
2023-06-15 14:16     ` Jens Axboe
2023-06-15 14:16   ` Bart Van Assche

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=baffcda4-4a9d-6631-a5bf-b36f59f82bae@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=dhavale@google.com \
    --cc=hch@lst.de \
    --cc=jyescas@google.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@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 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.