All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-block@vger.kernel.org
Cc: martin.petersen@oracle.com, Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 3/3] block: only call bio_integrity_prep() if necessary
Date: Thu, 11 Jan 2024 09:00:21 -0700	[thread overview]
Message-ID: <20240111160226.1936351-4-axboe@kernel.dk> (raw)
In-Reply-To: <20240111160226.1936351-1-axboe@kernel.dk>

Now that the queue is flag as having an actual profile or not, avoid
calling into the integrity code unless we have one. This removes some
overhead from blk_mq_submit_bio() if BLK_DEV_INTEGRITY is enabled and
we don't have any profiles attached, which is the default and expected
case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 block/blk-mq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 37268656aae9..965e42a1bbde 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2961,7 +2961,8 @@ bool blk_mq_submit_bio(struct bio *bio)
 
 	bio_set_ioprio(bio);
 
-	if (!bio_integrity_prep(bio))
+	if (test_bit(QUEUE_FLAG_INTG_PROFILE, &q->queue_flags) &&
+	    !bio_integrity_prep(bio))
 		return false;
 
 	if (plug) {
-- 
2.43.0


  parent reply	other threads:[~2024-01-11 16:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 16:00 [PATCHSET 0/3] Integrity cleanups and optimization Jens Axboe
2024-01-11 16:00 ` [PATCH 1/3] block/integrity: make profile optional Jens Axboe
2024-01-11 16:05   ` Christoph Hellwig
2024-01-11 16:09   ` Keith Busch
2024-01-11 16:19     ` Jens Axboe
2024-01-11 16:00 ` [PATCH 2/3] block/integrity: flag the queue if it has an integrity profile Jens Axboe
2024-01-11 16:06   ` Christoph Hellwig
2024-01-11 16:16     ` Jens Axboe
2024-01-11 16:18       ` Christoph Hellwig
2024-01-11 16:00 ` Jens Axboe [this message]
2024-01-11 16:28   ` [PATCH 3/3] block: only call bio_integrity_prep() if necessary Keith Busch
2024-01-11 18:50     ` Jens Axboe
2024-01-11 16:08 ` [PATCHSET 0/3] Integrity cleanups and optimization Christoph Hellwig
2024-01-11 16:24   ` Martin K. Petersen
2024-01-11 16:34     ` Mike Snitzer
2024-01-11 17:07       ` Mike Snitzer

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=20240111160226.1936351-4-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.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.