FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 09-09-2010, 02:44 PM
Steven Whitehouse
 
Default GFS2: Use new workqueue scheme (try #2)

Incidentally, this updated patch seems to run the postmark
test even faster than the previous version :-)

>From 612ea747e44877b7fb969746570913fbb0f81494 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Thu, 9 Sep 2010 15:10:43 +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, may
run for a long time, and each individual work should only
be scheduled once anywhere in the system.

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

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Tejun Heo <tj@kernel.org>

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 8e478e2..0c176ca 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1783,10 +1783,13 @@ 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_NON_REENTRANT |
+ WQ_FREEZEABLE, 0);
if (IS_ERR(gfs2_delete_workqueue)) {
destroy_workqueue(glock_workqueue);
return PTR_ERR(gfs2_delete_workqueue);
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index b1e9630..f848cac 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -140,7 +140,8 @@ static int __init init_gfs2_fs(void)

error = -ENOMEM;
gfs_recovery_wq = alloc_workqueue("gfs_recovery",
- WQ_NON_REENTRANT | WQ_RESCUER, 0);
+ WQ_NON_REENTRANT | WQ_RESCUER |
+ WQ_FREEZEABLE, 0);
if (!gfs_recovery_wq)
goto fail_wq;

--
1.7.1.1
 
Old 09-09-2010, 02:59 PM
Steven Whitehouse
 
Default GFS2: Use new workqueue scheme (try #2)

Hi,

On Thu, 2010-09-09 at 16:48 +0200, Tejun Heo wrote:
> Hello,
>
> On 09/09/2010 04:44 PM, Steven Whitehouse wrote:
> > Incidentally, this updated patch seems to run the postmark
> > test even faster than the previous version :-)
>
> Ah, cool. :-)
>
> Just one more thing.
>
> > - gfs2_delete_workqueue = create_workqueue("delete_workqueue");
> > + gfs2_delete_workqueue = alloc_workqueue("delete_workqueue", WQ_RESCUER |
> > + WQ_NON_REENTRANT |
> > + WQ_FREEZEABLE, 0);
>
> The original create_workqueue() is (cross-CPU) reentrant, so adding
> WQ_NON_REENTRANT there is adding one more restriction. Is this
> intentional?
>
The original code relied upon the submission code to prevent this from
happening. It seemed like a good idea to declare this explicitly, but
again it is not actually required, as such.

> > error = -ENOMEM;
> > gfs_recovery_wq = alloc_workqueue("gfs_recovery",
> > - WQ_NON_REENTRANT | WQ_RESCUER, 0);
> > + WQ_NON_REENTRANT | WQ_RESCUER |
> > + WQ_FREEZEABLE, 0);
>
> Looks like patch wasn't generated on a clean tree. The same question
> too. If it worked fine w/ create_workqueue() before, you don't need
> NON_REENTRANT.
>
> Thanks.
>
And the same here. The tree I'm using is my -nmw GFS2 tree since that is
where I'd intended to queue the resulting patch,

Steve.
 

Thread Tools




All times are GMT. The time now is 12:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org