linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH 3/4] block: move queue enter logic into blk_mq_submit_bio()
Date: Thu, 4 Nov 2021 11:35:49 -0600	[thread overview]
Message-ID: <33138951-e79e-caa3-efbb-465af41c7b56@kernel.dk> (raw)
In-Reply-To: <YYQZQKDBAUhQnqsq@infradead.org>

On 11/4/21 11:32 AM, Christoph Hellwig wrote:
> On Thu, Nov 04, 2021 at 06:14:30AM -0600, Jens Axboe wrote:
>> To player it safer, I would suggest we fold in something like the
>> below. That keeps the submit_checks() under the queue enter.
> 
> Yes, this looks much better.  Nit below:
> 
>>  	struct block_device *bdev = bio->bi_bdev;
>>  	struct request_queue *q = bdev_get_queue(bdev);
>> @@ -868,14 +868,13 @@ static void __submit_bio(struct bio *bio)
>>  {
>>  	struct gendisk *disk = bio->bi_bdev->bd_disk;
>>  
>> -	if (!submit_bio_checks(bio) || !blk_crypto_bio_prep(&bio))
>> -		return;
>>  	if (!disk->fops->submit_bio) {
>>  		blk_mq_submit_bio(bio);
>>  	} else {
>>  		if (unlikely(bio_queue_enter(bio) != 0))
>>  			return;
>> -		disk->fops->submit_bio(bio);
>> +		if (submit_bio_checks(bio) && blk_crypto_bio_prep(&bio))
>> +			disk->fops->submit_bio(bio);
>>  		blk_queue_exit(disk->queue);
>>  	}
> 
> A this point moving the whole ->submit_bio based branch into a
> helper probably makes sense as well.

Sure, I can do that.

>> +	if (unlikely(!blk_crypto_bio_prep(&bio)))
>> +		return;
>> +
>>  	blk_queue_bounce(q, &bio);
>>  	if (blk_may_split(q, bio))
>>  		__blk_queue_split(q, &bio, &nr_segs);
>> @@ -2551,6 +2554,8 @@ void blk_mq_submit_bio(struct bio *bio)
>>  
>>  		if (unlikely(!blk_mq_queue_enter(q, bio)))
>>  			return;
>> +		if (unlikely(!submit_bio_checks(bio)))
>> +			goto put_exit;
> 
> This now skips the checks for the cached request case, doesn't it?

It did, I did add that when folding it in though.

-- 
Jens Axboe


  reply	other threads:[~2021-11-04 17:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 18:32 [PATCHSET 0/4] Alloc batch fixes Jens Axboe
2021-11-03 18:32 ` [PATCH 1/4] block: have plug stored requests hold references to the queue Jens Axboe
2021-11-04  9:01   ` Christoph Hellwig
2021-11-04 11:33     ` Jens Axboe
2021-11-03 18:32 ` [PATCH 2/4] block: make blk_try_enter_queue() available for blk-mq Jens Axboe
2021-11-03 18:32 ` [PATCH 3/4] block: move queue enter logic into blk_mq_submit_bio() Jens Axboe
2021-11-04  9:10   ` Christoph Hellwig
2021-11-04 11:41     ` Jens Axboe
2021-11-04 12:14       ` Jens Axboe
2021-11-04 17:32         ` Christoph Hellwig
2021-11-04 17:35           ` Jens Axboe [this message]
2021-11-04 17:30       ` Christoph Hellwig
2021-11-04 17:36         ` Jens Axboe
2021-11-03 18:32 ` [PATCH 4/4] block: move plug rq alloc into helper and ensure queue match Jens Axboe
2021-11-04  9:17   ` Christoph Hellwig
2021-11-04 11:35     ` Jens Axboe
2021-11-04 17:33       ` Christoph Hellwig
2021-11-04 17:37         ` Jens Axboe

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=33138951-e79e-caa3-efbb-465af41c7b56@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.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).