Message ID | 20240111160226.1936351-4-axboe@kernel.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Integrity cleanups and optimization | expand |
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@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; 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?
On 1/11/24 9:28 AM, Keith Busch wrote: > 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@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; > > 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? Yeah, I just came to the same conclusion diving a bit deeper into this. It's a bit of a mess imho, but you are right that previously, by default, we'd get metadata buffers attached with a dummy profile and with this we would not. I'll drop this for now, I think this requires more involved work to make this sane.
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) {
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(-)