Which core does a NVMe IO request would go?

harryxiyou harryxiyou at gmail.com
Wed Sep 10 12:46:21 PDT 2014


On Thu, Sep 11, 2014 at 3:43 AM, harryxiyou <harryxiyou at gmail.com> wrote:
> Dear all,
>
> I am not sure "Which core does a NVMe IO request would go?" after
> I read the NVMe driver source codes.
>
> The code says that,
>
>
>  648 static int nvme_make_request(struct request_queue *q, struct request *req)
>  649 {
>  650     struct nvme_ns *ns = q->queuedata;
>  651     struct nvme_queue *nvmeq = get_nvmeq(ns->dev);
> ...
>  659
>  660     return result;
>  661 }
>
>
>  289 struct nvme_queue *get_nvmeq(struct nvme_dev *dev)
>  290 {
>  291     return dev->queues[get_cpu() + 1];
>  292 }
>
>
> dev->queues[get_cpu() + 1] tells us which core it goes but I don't know
> what get_cpu() returns.
>
>
> Could you please give me some suggestions?

Maybe, I find the answers like this.

get_cpu() disables kernel preemption prior to returning the current
processor number


>
>
> Thanks, Harry



More information about the Linux-nvme mailing list