[PATCH v2 3/4] nvme-pci: factor out the cqe reading mechanics from __nvme_process_cq

Sagi Grimberg sagi at grimberg.me
Mon Jun 19 09:32:22 PDT 2017


>> Also, maintain a consumed counter to rely on for doorbell and
>> cqe_seen update instead of directly relying on the cq head and phase.
>>
>> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> 
> Looks like this particular change failed to produce the best diff. :)

:(

>> -	nvme_ring_cq_doorbell(nvmeq);
>> +		if (tag && *tag == cqe.command_id) {
>> +			*tag = -1;
>> +			break;
> 
> This 'break' is new. We're already holding the lock, why wouldn't we
> want to reap all the completions?

Oddly enough I (re)noticed it now too. I guess that my thought was that
if we were invoked from ->poll, it means that the user wants the
completion asap and willing to put some extra efforts in order to get
it faster... So if you think about it, any action you take post finding
the completion is not what the user wants...

This absolutely needs to be documented, or actually come as a separate 
patch... I can also get rid of it if its a dumb idea...



More information about the Linux-nvme mailing list