[PATCH 01/14] nvmet: for pt I/O cmds annotate req->sg_cnt likely

Logan Gunthorpe logang at deltatee.com
Mon Aug 10 18:55:54 EDT 2020



On 2020-08-10 4:54 p.m., Chaitanya Kulkarni wrote:
> On 8/10/20 14:54, Logan Gunthorpe wrote:
>> Hey,
>>
>> You forgot to CC me again....
>>
> Ugghhh..
>> On 2020-08-10 12:54 p.m., Chaitanya Kulkarni wrote:
>>> I/O Commands (nvme_cmd_read, nvme_cmd_write) are most command commands
>>> when accessing passthru controller. For I/O commands data is represented
>>> in SG list, so sg_cnt != 0 in most cases.
>>>
>>> Annotate req->sg_cnt check with likely.
>> Does adding these likely annotations actually produce any benefit? Why
>> can't we rely on the branch predictor in these instances?
>>
> 
> They are present in the target code. I don't see any problem having it 
> in a passthru code unless it shows severe performance degradation.

Isn't that backwards? Don't we only add performance optimizations (which
likely/unlikely are) when they show demonstrable increases in performance?

Logan



More information about the Linux-nvme mailing list