Skip to contentSkip to conversation

GFS2: Use new workqueue scheme

Cluster-devel Steven Whitehouse 1 participant 2 messages Sep 13, 2010 – Sep 14, 2010 1 message not in the archive GFS2 file system

lore
Share & tools
lore
#0 lore raw

Hi,

Hopefully this is the final version :-)

Steve.

From 29e8eb2a793cbf7ccba398b93f362a17f8cb4e6a Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Mon, 13 Sep 2010 16:23:00 +0100
Subject: GFS2: Use new workqueue scheme

The recovery workqueue can be freezable since
we want it to finish what it is doing if the system is to be frozen (although why you'd want to freeze a cluster node is beyond me since it will result in it being ejected from the cluster). It does still make sense for single node GFS2 filesystems though.

The glock workqueue will benefit from being able to run more work items concurrently. A test running postmark shows improved performance and multi-threaded workloads are likely to benefit even more.

The delete workqueue is similar to the recovery workqueue in that it must not get blocked by memory allocations, and may run for a long time.

Potentially other GFS2 threads might also be converted to workqueues, but I'll leave that for a later patch.

fs/gfs2/glock.c +4 -2
index 8e478e2..c3f2a5c 100644
@@ -1783,10 +1783,12 @@ int __init gfs2_glock_init(void)
 	}
 #endif
 
-	glock_workqueue = create_workqueue("glock_workqueue");
+	glock_workqueue = alloc_workqueue("glock_workqueue", WQ_RESCUER |
+					  WQ_HIGHPRI | WQ_FREEZEABLE, 0);
 	if (IS_ERR(glock_workqueue))
 		return PTR_ERR(glock_workqueue);
-	gfs2_delete_workqueue = create_workqueue("delete_workqueue");
+	gfs2_delete_workqueue = alloc_workqueue("delete_workqueue", WQ_RESCUER |
+						WQ_FREEZEABLE, 0);
 	if (IS_ERR(gfs2_delete_workqueue)) {
 		destroy_workqueue(glock_workqueue);
 		return PTR_ERR(gfs2_delete_workqueue);
fs/gfs2/main.c +1 -1
index b1e9630..1c8bbf2 100644
@@ -140,7 +140,7 @@ static int __init init_gfs2_fs(void)
 
 	error = -ENOMEM;
 	gfs_recovery_wq = alloc_workqueue("gfs_recovery",
-					  WQ_NON_REENTRANT | WQ_RESCUER, 0);
+					  WQ_RESCUER | WQ_FREEZEABLE, 0);
 	if (!gfs_recovery_wq)
 		goto fail_wq;
 
Signature · 1 line
1.7.1.1
#2 lore raw
In reply to a message not in the archive

Hi,

Quoted 10 lines · Tejun Heo

Hello,

Quoted 4 lines · Steven Whitehouse
Quoted 1 line

From 29e8eb2a793cbf7ccba398b93f362a17f8cb4e6a Mon Sep 17 00:00:00 2001

From: Steven Whitehouse <[email protected]>
Date: Mon, 13 Sep 2010 16:23:00 +0100
Subject: GFS2: Use new workqueue scheme

The changes look good to me.

Quoted 8 lines

fs/gfs2/glock.c int __init gfs2_glock_init(void) · line 1787

Quoted 3 lines
fs/gfs2/glock.c +2 -1
-	glock_workqueue = create_workqueue("glock_workqueue");
+	glock_workqueue = alloc_workqueue("glock_workqueue", WQ_RESCUER |
+					  WQ_HIGHPRI | WQ_FREEZEABLE, 0);

Maybe explaning why HIGHPRI is necessary here would be a good idea?

Thanks for the review, I've updated that in the version now pushed into my -nmw GFS2 tree.

Quoted 6 lines
Quoted 6 lines
fs/gfs2/main.c +0 -0
index b1e9630..1c8bbf2 100644
@@ -140,7 +140,7 @@ static int __init init_gfs2_fs(void)
 
Quoted 9 lines

fs/gfs2/main.c static int __init init_gfs2_fs(void) · line 143

Quoted 4 lines
fs/gfs2/main.c +1 -1
 	error = -ENOMEM;
 	gfs_recovery_wq = alloc_workqueue("gfs_recovery",
-					  WQ_NON_REENTRANT | WQ_RESCUER, 0);
+					  WQ_RESCUER | WQ_FREEZEABLE, 0);

GFS2 was already using alloc_workqueue() before this patch?

Thanks.

Yes, due to this patch:

commit 6ecd7c2dd9f5dd4f6e8f65c8027159f9c73b0e4c

Author: Tejun Heo <[email protected]>
Date:   Tue Jul 20 22:09:02 2010 +0200

gfs2: use workqueue instead of slow-work

:-)

Steve.