Skip to content

Commit b25b957

Browse files
mikechristiemartinkpetersen
authored andcommitted
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/[email protected] Reviewed-by: Lee Duncan <[email protected]> Signed-off-by: Mike Christie <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 06c203a commit b25b957

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/scsi/scsi_transport_iscsi.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ static DECLARE_WORK(stop_conn_work, stop_conn_work_fn);
9595
static atomic_t iscsi_session_nr; /* sysfs session id for next new session */
9696
static struct workqueue_struct *iscsi_eh_timer_workq;
9797

98-
static struct workqueue_struct *iscsi_destroy_workq;
99-
10098
static DEFINE_IDA(iscsi_sess_ida);
10199
/*
102100
* list of registered transports and lock that must
@@ -3724,7 +3722,7 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
37243722
list_del_init(&session->sess_list);
37253723
spin_unlock_irqrestore(&sesslock, flags);
37263724

3727-
queue_work(iscsi_destroy_workq, &session->destroy_work);
3725+
queue_work(system_unbound_wq, &session->destroy_work);
37283726
}
37293727
break;
37303728
case ISCSI_UEVENT_UNBIND_SESSION:
@@ -4820,18 +4818,8 @@ static __init int iscsi_transport_init(void)
48204818
goto release_nls;
48214819
}
48224820

4823-
iscsi_destroy_workq = alloc_workqueue("%s",
4824-
WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
4825-
1, "iscsi_destroy");
4826-
if (!iscsi_destroy_workq) {
4827-
err = -ENOMEM;
4828-
goto destroy_wq;
4829-
}
4830-
48314821
return 0;
48324822

4833-
destroy_wq:
4834-
destroy_workqueue(iscsi_eh_timer_workq);
48354823
release_nls:
48364824
netlink_kernel_release(nls);
48374825
unregister_flashnode_bus:
@@ -4853,7 +4841,6 @@ static __init int iscsi_transport_init(void)
48534841

48544842
static void __exit iscsi_transport_exit(void)
48554843
{
4856-
destroy_workqueue(iscsi_destroy_workq);
48574844
destroy_workqueue(iscsi_eh_timer_workq);
48584845
netlink_kernel_release(nls);
48594846
bus_unregister(&iscsi_flashnode_bus);

0 commit comments

Comments
 (0)