Skip to contentSkip to conversation

fs/ocfs2/dlmfs: Remove deprecated create_singlethread_workqueue

PATCH Applied Bhaktipriya Shridhar 2 participants 5 messages Aug 30, 2016 – Aug 31, 2016 1 message not in the archive OCFS2

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/4 fs/ocfs2/dlmfs: Remove deprecated create_singlethread_workqueue

In reply to a message not in the archive

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

#2 lore raw

PATCH v2 2/4 fs/ocfs2/cluster: Remove deprecated create_singlethread_workqueue

In reply to a message not in the archive

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.

---
Changes in v2:
-No changes.

 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

#3 lore raw

PATCH v2 3/4 fs/ocfs2/super: Remove deprecated create_singlethread_workqueue

In reply to a message not in the archive

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.

---
Changes in v2:
-No change.

 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

#4 lore raw

PATCH v2 4/4 fs/ocfs2/dlm: Remove deprecated create_singlethread_workqueue

In reply to a message not in the archive

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.

---
Changes in v2:
-No change

 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

Acked-by on v2 4/4
#5 lore raw

Re: [PATCH v2 4/4] fs/ocfs2/dlm: Remove deprecated create_singlethread_workqueue

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.

Just for the record,

Thanks.

Signature · 1 line
tejun