scsi: mpt: Remove deprecated create_singlethread_workqueue
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Tue, 30 Aug 2016 19:03:25 +0000 (00:33 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 2 Sep 2016 10:13:57 +0000 (06:13 -0400)
The workqueues "ioc->reset_work_q" and "ioc->fw_event_q" queue a single
work item &ioc->fault_reset_work and &fw_event->work, respectively and
hence don't require ordering. Hence, they have been converted to use
alloc_workqueue().

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
memory pressure since the workqueue belongs to a storage driver which is
being used on a memory reclaim path.

Since there are fixed number of work items, explicit concurrency limit
is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptbase.c

index 5537f8df85121cca06b5ba9369b43ab1e64d7826..89c7ed16b4df13057fcadb712ee369316c514ac6 100644 (file)
@@ -1865,8 +1865,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 
        snprintf(ioc->reset_work_q_name, MPT_KOBJ_NAME_LEN,
                 "mpt_poll_%d", ioc->id);
-       ioc->reset_work_q =
-               create_singlethread_workqueue(ioc->reset_work_q_name);
+       ioc->reset_work_q = alloc_workqueue(ioc->reset_work_q_name,
+                                           WQ_MEM_RECLAIM, 0);
        if (!ioc->reset_work_q) {
                printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n",
                    ioc->name);
@@ -1992,7 +1992,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
        INIT_LIST_HEAD(&ioc->fw_event_list);
        spin_lock_init(&ioc->fw_event_lock);
        snprintf(ioc->fw_event_q_name, MPT_KOBJ_NAME_LEN, "mpt/%d", ioc->id);
-       ioc->fw_event_q = create_singlethread_workqueue(ioc->fw_event_q_name);
+       ioc->fw_event_q = alloc_workqueue(ioc->fw_event_q_name,
+                                         WQ_MEM_RECLAIM, 0);
        if (!ioc->fw_event_q) {
                printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n",
                    ioc->name);