scst_local: Use all CPUs for command processing

This patch modifies scst_local such that on kernel version 3.19 and
later multiple hardware queues are used (scsi-mq). Note: in order
to benefit from concurrent processing, the number of SCST command
threads must be set to a value above one.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7509 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2018-10-14 04:03:57 +00:00
parent 2f1cc8382f
commit ec73c01358

View File

@@ -809,8 +809,9 @@ static int scst_local_abort(struct scsi_cmnd *scmd)
sess = to_scst_lcl_sess(scsi_get_device(scmd->device->host));
ret = scst_rx_mgmt_fn_tag(sess->scst_sess, SCST_ABORT_TASK, scmd->tag,
false, &dev_reset_completion);
ret = scst_rx_mgmt_fn_tag(sess->scst_sess, SCST_ABORT_TASK,
blk_mq_unique_tag(scmd->request),
false, &dev_reset_completion);
/* Now wait for the completion ... */
wait_for_completion_interruptible(&dev_reset_completion);
@@ -1008,7 +1009,7 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *scmd,
return SCSI_MLQUEUE_HOST_BUSY;
}
scst_cmd_set_tag(scst_cmd, scmd->tag);
scst_cmd_set_tag(scst_cmd, blk_mq_unique_tag(scmd->request));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
if (scmd->device->tagged_supported && scmd->device->simple_tags)
scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE);
@@ -1682,6 +1683,10 @@ static int scst_local_driver_probe(struct device *dev)
goto out;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
hpnt->nr_hw_queues = num_possible_cpus();
#endif
sess->shost = hpnt;
hpnt->max_id = 1; /* Don't want more than one id */