setting nvme irq per cpu affinity in device driver

Keith Busch keith.busch at intel.com
Thu Sep 3 07:14:41 PDT 2015


On Wed, 2 Sep 2015, 김경산 wrote:
> Hello, Keith Busch.
> Thank you for your opinion. Yes, we've already considered the approach.
>
> However, there were two issues regarding the way.
> 1. In our tests, setting affinity hint is not working on 4.2-rc6 driver.
> Please find below code. It is current implementation (4.2-rc6)for setting
> affinity hint.
>
> static void nvme_set_irq_hints(struct nvme_dev *dev) {
>        struct nvme_queue *nvmeq;
>        int i;
>
>        for (i = 0; i < dev->online_queues; i++) {
>                nvmeq = dev->queues[i];
>
>                if (!nvmeq->tags || !(*nvmeq->tags))
>                        continue; 
>
>                /*kyungsan : <- not reach here from second loop*/
>
>                irq_set_affinity_hint(dev->entry[nvmeq->cq_vector].vector,
>                                        blk_mq_tags_cpumask(*nvmeq->tags));
>        }
> }
>
> As tags information is not properly configured, setting affinity for IO CQs
> is not applied. 
> It is only applied on Admin CQ.

Ok, that's a bug. We can't set the hints before the nvmeq's tagset hw
context initialized. That doesn't happen until after a request queue is
allocated, which happens aynchronously now, but it's an easy fix.


More information about the Linux-nvme mailing list