Skip to contentSkip to conversation

Remove deprecated create_singlethread_workqueue

PATCH Superseded Bhaktipriya Shridhar 3 participants 15 messages Aug 30, 2016 – Aug 31, 2016

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Remove deprecated create_singlethread_workqueue

This patch set removes deprecated create_singlethread_workqueue usages in fs/.

Bhaktipriya Shridhar (9):
fs/afs/vlocation: Remove deprecated create_singlethread_workqueue fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue fs/afs/callback: Remove deprecated create_singlethread_workqueue fs/afs/flock: Remove deprecated create_singlethread_workqueue fs/ocfs2/dlmfs: Remove deprecated create_singlethread_workqueue fs/ocfs2/cluster: Remove deprecated create_singlethread_workqueue fs/ocfs2/super: Remove deprecated create_singlethread_workqueue fs/ocfs2/dlm: Remove deprecated create_singlethread_workqueue fs/nfsd/nfs4callback: Remove deprecated create_singlethread_workqueue

 fs/afs/callback.c        | 4 ++--
 fs/afs/flock.c           | 4 ++--
 fs/afs/rxrpc.c           | 2 +-
 fs/afs/vlocation.c       | 4 ++--
 fs/nfsd/nfs4callback.c   | 2 +-
 fs/ocfs2/cluster/tcp.c   | 2 +-
 fs/ocfs2/dlm/dlmdomain.c | 2 +-
 fs/ocfs2/dlmfs/dlmfs.c   | 2 +-
 fs/ocfs2/super.c         | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

--
2.1.4

#1 lore raw

PATCH 1/9 fs/afs/vlocation: Remove deprecated create_singlethread_workqueue

The workqueue "afs_vlocation_update_worker" queues a single work item &afs_vlocation_update and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

Since the workqueue is being used on a memory reclaim path, WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure.

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

---
 fs/afs/vlocation.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/vlocation.c +2 -2
index 5297678..45a8639 100644
@@ -594,8 +594,8 @@ static void afs_vlocation_reaper(struct work_struct *work)
  */
 int __init afs_vlocation_update_init(void)
 {
-	afs_vlocation_update_worker =
-		create_singlethread_workqueue("kafs_vlupdated");
+	afs_vlocation_update_worker = alloc_workqueue("kafs_vlupdated",
+						      WQ_MEM_RECLAIM, 0);
 	return afs_vlocation_update_worker ? 0 : -ENOMEM;
 }
 

--
2.1.4

#2 lore raw

PATCH 2/9 fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "afs_async_calls" queues a single work item viz &call->async_work and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure because the workqueue is being used on a memory reclaim path.

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

---
 fs/afs/rxrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/afs/rxrpc.c +1 -1
index 63cd9f9..4f9e9b3 100644
@@ -85,7 +85,7 @@ int afs_open_socket(void)
 
 	skb_queue_head_init(&afs_incoming_calls);
 
-	afs_async_calls = create_singlethread_workqueue("kafsd");
+	afs_async_calls = alloc_workqueue("kafsd", WQ_MEM_RECLAIM, 0);
 	if (!afs_async_calls) {
 		_leave(" = -ENOMEM [wq]");
 		return -ENOMEM;

--
2.1.4

#3 lore raw

PATCH 3/9 fs/afs/callback: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "afs_callback_update_worker" queues multiple work items viz &vnode->cb_broken_work, &server->cb_break_work which require strict execution ordering. Hence, an ordered dedicated workqueue has been used.

Since the workqueue is being used on a memory reclaim path, WQ_MEM_RECLAIM has been set to ensure forward progress under memory pressure.

---
 fs/afs/callback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/callback.c +2 -2
index 7ef637d..1e9d2f8 100644
@@ -461,8 +461,8 @@ static void afs_callback_updater(struct work_struct *work)
  */
 int __init afs_callback_update_init(void)
 {
-	afs_callback_update_worker =
-		create_singlethread_workqueue("kafs_callbackd");
+	afs_callback_update_worker = alloc_ordered_workqueue("kafs_callbackd",
+							     WQ_MEM_RECLAIM);
 	return afs_callback_update_worker ? 0 : -ENOMEM;
 }
 

--
2.1.4

#4 lore raw

PATCH 4/9 fs/afs/flock: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "afs_lock_manager" queues a single work item &vnode->lock_work, and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure because the workqueue is being used on a memory reclaim path.

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

---
 fs/afs/flock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/flock.c +2 -2
index d91a9c9..3191dff 100644
@@ -36,8 +36,8 @@ static int afs_init_lock_manager(void)
 	if (!afs_lock_manager) {
 		mutex_lock(&afs_lock_manager_mutex);
 		if (!afs_lock_manager) {
-			afs_lock_manager =
-				create_singlethread_workqueue("kafs_lockd");
+			afs_lock_manager = alloc_workqueue("kafs_lockd",
+							   WQ_MEM_RECLAIM, 0);
 			if (!afs_lock_manager)
 				ret = -ENOMEM;
 		}

--
2.1.4

#6 lore raw

PATCH 5/9 fs/ocfs2/dlmfs: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "user_dlm_worker" queues a single work item &lockres->l_work per user_lock_res instance and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure.

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

---
 fs/ocfs2/dlmfs/dlmfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlmfs/dlmfs.c +1 -1
index 47b3b2d..afe6e10 100644
@@ -646,7 +646,7 @@ static int __init init_dlmfs_fs(void)
 	}
 	cleanup_inode = 1;
 
-	user_dlm_worker = create_singlethread_workqueue("user_dlm");
+	user_dlm_worker = alloc_workqueue("user_dlm", WQ_MEM_RECLAIM, 0);
 	if (!user_dlm_worker) {
 		status = -ENOMEM;
 		goto bail;

--
2.1.4

#7 lore raw

PATCH 6/9 fs/ocfs2/cluster: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "o2net_wq" queues multiple work items viz &old_sc->sc_shutdown_work, &sc->sc_rx_work, &sc->sc_connect_work which require strict execution ordering. Hence, an ordered dedicated workqueue has been used.

WQ_MEM_RECLAIM has been set to ensure forward progress under memory pressure.

---
 fs/ocfs2/cluster/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/cluster/tcp.c +1 -1
index 4238eb2..47afe9c 100644
@@ -2108,7 +2108,7 @@ int o2net_start_listening(struct o2nm_node *node)
 	BUG_ON(o2net_listen_sock != NULL);
 
 	mlog(ML_KTHREAD, "starting o2net thread...\n");
-	o2net_wq = create_singlethread_workqueue("o2net");
+	o2net_wq = alloc_ordered_workqueue("o2net", WQ_MEM_RECLAIM);
 	if (o2net_wq == NULL) {
 		mlog(ML_ERROR, "unable to launch o2net thread\n");
 		return -ENOMEM; /* ? */

--
2.1.4

#8 lore raw

PATCH 7/9 fs/ocfs2/super: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "ocfs2_wq" queues multiple work items viz &osb->la_enable_wq, &journal->j_recovery_work, &os->os_orphan_scan_work, &osb->osb_truncate_log_wq which require strict execution ordering. Hence, an ordered dedicated workqueue has been used.

WQ_MEM_RECLAIM has been set to ensure forward progress under memory pressure because the workqueue is being used on a memory reclaim path.

---
 fs/ocfs2/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/super.c +1 -1
index d7cae33..af5285d 100644
@@ -2330,7 +2330,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
 	}
 	cleancache_init_shared_fs(sb);
 
-	osb->ocfs2_wq = create_singlethread_workqueue("ocfs2_wq");
+	osb->ocfs2_wq = alloc_ordered_workqueue("ocfs2_wq", WQ_MEM_RECLAIM);
 	if (!osb->ocfs2_wq) {
 		status = -ENOMEM;
 		mlog_errno(status);

--
2.1.4

#9 lore raw

PATCH 8/9 fs/ocfs2/dlm: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "dlm_worker" queues a single work item &dlm->dispatched_work and thus it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure.

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

---
 fs/ocfs2/dlm/dlmdomain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlm/dlmdomain.c +1 -1
index 12e064b..dc30f38 100644
@@ -1906,7 +1906,7 @@ static int dlm_join_domain(struct dlm_ctxt *dlm)
 	}
 
 	snprintf(wq_name, O2NM_MAX_NAME_LEN, "dlm_wq-%s", dlm->name);
-	dlm->dlm_worker = create_singlethread_workqueue(wq_name);
+	dlm->dlm_worker = alloc_workqueue(wq_name, WQ_MEM_RECLAIM, 0);
 	if (!dlm->dlm_worker) {
 		status = -ENOMEM;
 		mlog_errno(status);

--
2.1.4

#11 lore raw

PATCH 9/9 fs/nfsd/nfs4callback: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar

The workqueue "callback_wq" queues a single work item &cb->cb_work per nfsd4_callback instance and thus, it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has not been set since this is an in-kernel nfs server and isn't involved in memory reclaim operations on the local host.

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

---
 fs/nfsd/nfs4callback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4callback.c +1 -1
index 7389cb1..a6611c6 100644
@@ -1021,7 +1021,7 @@ static const struct rpc_call_ops nfsd4_cb_ops = {
 
 int nfsd4_create_callback_queue(void)
 {
-	callback_wq = create_singlethread_workqueue("nfsd4_callbacks");
+	callback_wq = alloc_workqueue("nfsd4_callbacks", 0, 0);
 	if (!callback_wq)
 		return -ENOMEM;
 	return 0;

--
2.1.4

maintainer
#13 lore raw
In reply to Bhaktipriya Shridhar
Quoted 8 lines · Bhaktipriya Shridhar

This patch set removes deprecated create_singlethread_workqueue usages in fs/.

Bhaktipriya Shridhar (9):
fs/afs/vlocation: Remove deprecated create_singlethread_workqueue fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue fs/afs/callback: Remove deprecated create_singlethread_workqueue fs/afs/flock: Remove deprecated create_singlethread_workqueue

I'm removing the workqueue in fs/afs/rxrpc.c in one of my patches. Can I take your other three AFS patches myself and leave someone else to handle the non-AFS patches?

David

#14 lore raw

Hello David,

I'll mail another patchset with AFS, ocfs2 and nfsd patches separated out.

Thanks,
Bhaktipriya

Quoted 16 lines · David Howells
Quoted 8 lines · Bhaktipriya Shridhar

This patch set removes deprecated create_singlethread_workqueue usages in fs/.

Bhaktipriya Shridhar (9):
fs/afs/vlocation: Remove deprecated create_singlethread_workqueue fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue fs/afs/callback: Remove deprecated create_singlethread_workqueue fs/afs/flock: Remove deprecated create_singlethread_workqueue

I'm removing the workqueue in fs/afs/rxrpc.c in one of my patches. Can I take your other three AFS patches myself and leave someone else to handle the non-AFS patches?

David

Acked-by on v1 4/9
#5 lore raw

Re: [PATCH 4/9] fs/afs/flock: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar
Quoted 5 lines · Bhaktipriya Shridhar

The workqueue "afs_lock_manager" queues a single work item &vnode->lock_work, and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

Quoted 8 lines

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure because the workqueue is being used on a memory reclaim path.

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

For all afs patches,

Thanks.

Signature · 1 line
tejun
Acked-by on v1 8/9
#10 lore raw

Re: [PATCH 8/9] fs/ocfs2/dlm: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar
Quoted 5 lines · Bhaktipriya Shridhar

The workqueue "dlm_worker" queues a single work item &dlm->dispatched_work and thus it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

Quoted 7 lines

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure.

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

For all ocfs2 patches,

Thanks.

Signature · 1 line
tejun
Acked-by on v1 9/9
#12 lore raw

Re: [PATCH 9/9] fs/nfsd/nfs4callback: Remove deprecated create_singlethread_workqueue

In reply to Bhaktipriya Shridhar
Quoted 5 lines · Bhaktipriya Shridhar

The workqueue "callback_wq" queues a single work item &cb->cb_work per nfsd4_callback instance and thus, it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

Quoted 8 lines

The WQ_MEM_RECLAIM flag has not been set since this is an in-kernel nfs server and isn't involved in memory reclaim operations on the local host.

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

Thanks.

Signature · 1 line
tejun