On Thu, Jan 11, 2024 at 09:00:21AM -0700, Jens Axboe wrote: > 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@xxxxxxxxx> > --- > 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; I'm confused. The bio_integrity_prep() allocates the metadata buffer. Drivers that were previoulsy using the 'nop' profile for odd formats don't get a metadata buffer anymore?