Re: [PATCH 3/3] block: only call bio_integrity_prep() if necessary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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?

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.

-- 
Jens Axboe






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux