]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: target/core: Use system workqueues for TMF
authorBart Van Assche <bvanassche@acm.org>
Tue, 27 Nov 2018 23:51:59 +0000 (15:51 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 8 Dec 2018 02:20:07 +0000 (21:20 -0500)
A quote from SAM-5: "The order in which task management requests are
processed is not specified by the SCSI architecture model.  The SCSI
architecture model does not require in-order delivery of such task
management requests or processing by the task manager in the order
received. To guarantee the processing order of task management requests
referencing sent to a specific logical unit, an application client should
not have more than one such task management request pending to that logical
unit." This means that it is safe to use the system workqueues instead of
tmr_wq for processing TMFs. An intended side effect of this patch is that
it enables concurrent processing of TMFs.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: David Disseldorp <ddiss@suse.de>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_device.c
drivers/target/target_core_transport.c
include/target/target_core_base.h

index 1d51df2b3e77e7a20d14f96d30b82b175681fa6d..15805dec697ba3379d0e3a0c7331a088d6ab8750 100644 (file)
@@ -986,18 +986,6 @@ int target_configure_device(struct se_device *dev)
        if (ret)
                goto out_destroy_device;
 
-       /*
-        * Startup the struct se_device processing thread
-        */
-       dev->tmr_wq = alloc_workqueue("tmr-%s", WQ_MEM_RECLAIM | WQ_UNBOUND, 1,
-                                     dev->transport->name);
-       if (!dev->tmr_wq) {
-               pr_err("Unable to create tmr workqueue for %s\n",
-                       dev->transport->name);
-               ret = -ENOMEM;
-               goto out_free_alua;
-       }
-
        /*
         * Setup work_queue for QUEUE_FULL
         */
@@ -1026,8 +1014,6 @@ int target_configure_device(struct se_device *dev)
 
        return 0;
 
-out_free_alua:
-       core_alua_free_lu_gp_mem(dev);
 out_destroy_device:
        dev->transport->destroy_device(dev);
 out_free_index:
@@ -1046,8 +1032,6 @@ void target_free_device(struct se_device *dev)
        WARN_ON(!list_empty(&dev->dev_sep_list));
 
        if (target_dev_configured(dev)) {
-               destroy_workqueue(dev->tmr_wq);
-
                dev->transport->destroy_device(dev);
 
                mutex_lock(&device_mutex);
index b0416978ab99617c1ba548be8caae6cd4f0646a8..999178e7d9a5936e92ff5719232cad2cd852bcbe 100644 (file)
@@ -3412,7 +3412,7 @@ int transport_generic_handle_tmr(
        }
 
        INIT_WORK(&cmd->work, target_tmr_work);
-       queue_work(cmd->se_dev->tmr_wq, &cmd->work);
+       schedule_work(&cmd->work);
        return 0;
 }
 EXPORT_SYMBOL(transport_generic_handle_tmr);
index 6e34ec4df6b7cc3ff5c2f28ecaf6da880f5d198d..9d827e49fcc6a45cc4661db86ca11887e5ef3e4e 100644 (file)
@@ -796,7 +796,6 @@ struct se_device {
        struct t10_pr_registration *dev_pr_res_holder;
        struct list_head        dev_sep_list;
        struct list_head        dev_tmr_list;
-       struct workqueue_struct *tmr_wq;
        struct work_struct      qf_work_queue;
        struct list_head        delayed_cmd_list;
        struct list_head        state_list;