[PATCH V2 01/12] nvme-core: annotate nvme_alloc_request()
Sagi Grimberg
sagi at grimberg.me
Tue Sep 1 13:21:05 EDT 2020
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 5702a3843746..a62fdcbfd1cc 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -508,7 +508,7 @@ struct request *nvme_alloc_request(struct request_queue *q,
>> unsigned op = nvme_is_write(cmd) ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN;
>> struct request *req;
>>
>> - if (qid == NVME_QID_ANY) {
>> + if (unlikely(qid == NVME_QID_ANY)) {
>
> From your commit message, this should be likely(), right?
>
>> req = blk_mq_alloc_request(q, op, flags);
>> } else {
>> req = blk_mq_alloc_request_hctx(q, op, flags,
Chaitanya, can you check the objdump that the change actually
resulted in a different machine code, I've seen patches of this
sort lately where this annotation didn't change anything at all.
More information about the Linux-nvme
mailing list