[PATCH] nvmet_fc: Reduce work_q count

Sagi Grimberg sagi at grimberg.me
Sat Sep 30 10:17:13 PDT 2017


> @@ -504,9 +505,11 @@ nvmet_fc_queue_fcp_req(struct nvmet_fc_tgtport *tgtport,
>   	fcpreq->hwqid = queue->qid ?
>   			((queue->qid - 1) % tgtport->ops->max_hw_queues) : 0;
>   
> -	if (tgtport->ops->target_features & NVMET_FCTGTFEAT_CMD_IN_ISR)
> -		queue_work_on(queue->cpu, queue->work_q, &fod->work);
> -	else
> +	if (tgtport->ops->target_features & NVMET_FCTGTFEAT_CMD_IN_ISR) {
> +		cpu = (queue->cpu == WORK_CPU_UNBOUND) ?
> +					get_cpu() : queue->cpu;

Why doing this? Why not let workqueue choose it for you? it will
attempt your local cpu, but if its busy it will get someone else...

You can simply queue it with WORK_CPU_UNBOUND if it happened to be set
this way...



More information about the Linux-nvme mailing list