Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: iscsi: Use system_unbound_wq for destroy_work

Use the system_unbound_wq for async session destruction. We don't need a
dedicated workqueue for async session destruction because:

1. perf does not seem to be an issue since we only allow 1 active work.

2. it does not have deps with other system works and we can run them in
parallel with each other.

Link: https://lore.kernel.org/r/20210525181821.7617-6-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Mike Christie and committed by
Martin K. Petersen
b25b957d 06c203a5

+1 -14
+1 -14
drivers/scsi/scsi_transport_iscsi.c
··· 95 95 static atomic_t iscsi_session_nr; /* sysfs session id for next new session */ 96 96 static struct workqueue_struct *iscsi_eh_timer_workq; 97 97 98 - static struct workqueue_struct *iscsi_destroy_workq; 99 - 100 98 static DEFINE_IDA(iscsi_sess_ida); 101 99 /* 102 100 * list of registered transports and lock that must ··· 3722 3724 list_del_init(&session->sess_list); 3723 3725 spin_unlock_irqrestore(&sesslock, flags); 3724 3726 3725 - queue_work(iscsi_destroy_workq, &session->destroy_work); 3727 + queue_work(system_unbound_wq, &session->destroy_work); 3726 3728 } 3727 3729 break; 3728 3730 case ISCSI_UEVENT_UNBIND_SESSION: ··· 4818 4820 goto release_nls; 4819 4821 } 4820 4822 4821 - iscsi_destroy_workq = alloc_workqueue("%s", 4822 - WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, 4823 - 1, "iscsi_destroy"); 4824 - if (!iscsi_destroy_workq) { 4825 - err = -ENOMEM; 4826 - goto destroy_wq; 4827 - } 4828 - 4829 4823 return 0; 4830 4824 4831 - destroy_wq: 4832 - destroy_workqueue(iscsi_eh_timer_workq); 4833 4825 release_nls: 4834 4826 netlink_kernel_release(nls); 4835 4827 unregister_flashnode_bus: ··· 4841 4853 4842 4854 static void __exit iscsi_transport_exit(void) 4843 4855 { 4844 - destroy_workqueue(iscsi_destroy_workq); 4845 4856 destroy_workqueue(iscsi_eh_timer_workq); 4846 4857 netlink_kernel_release(nls); 4847 4858 bus_unregister(&iscsi_flashnode_bus);