diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-06-24 01:03:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:06:31 -0400 |
commit | 58da282b733cff4caef805c6555c7a3b90772946 (patch) | |
tree | 3defc7d637584c133421b6a0314756cb78467bc9 | |
parent | dfc8356570b6fcb4035c7d916ade5bbbe6c3b50a (diff) |
[PATCH] knfsd: nfsd4: create separate laundromat workqueue
We're running the laundromat work on the default kevent worker thread. But
the laundromat takes the nfsv4 state semaphore, which is used for way too much
stuff, and the potential for deadlocks is high. Better to have this on a
separate workqueue.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/nfsd/nfs4state.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 2a5f00b0ee99..9bec088e7657 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1844,6 +1844,7 @@ out: | |||
1844 | return status; | 1844 | return status; |
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | static struct workqueue_struct *laundry_wq; | ||
1847 | static struct work_struct laundromat_work; | 1848 | static struct work_struct laundromat_work; |
1848 | static void laundromat_main(void *); | 1849 | static void laundromat_main(void *); |
1849 | static DECLARE_WORK(laundromat_work, laundromat_main, NULL); | 1850 | static DECLARE_WORK(laundromat_work, laundromat_main, NULL); |
@@ -1951,7 +1952,7 @@ laundromat_main(void *not_used) | |||
1951 | 1952 | ||
1952 | t = nfs4_laundromat(); | 1953 | t = nfs4_laundromat(); |
1953 | dprintk("NFSD: laundromat_main - sleeping for %ld seconds\n", t); | 1954 | dprintk("NFSD: laundromat_main - sleeping for %ld seconds\n", t); |
1954 | schedule_delayed_work(&laundromat_work, t*HZ); | 1955 | queue_delayed_work(laundry_wq, &laundromat_work, t*HZ); |
1955 | } | 1956 | } |
1956 | 1957 | ||
1957 | /* search ownerid_hashtbl[] and close_lru for stateid owner | 1958 | /* search ownerid_hashtbl[] and close_lru for stateid owner |
@@ -3211,7 +3212,8 @@ __nfs4_state_init(void) | |||
3211 | printk("NFSD: starting %ld-second grace period\n", grace_time); | 3212 | printk("NFSD: starting %ld-second grace period\n", grace_time); |
3212 | grace_end = boot_time + grace_time; | 3213 | grace_end = boot_time + grace_time; |
3213 | INIT_WORK(&laundromat_work,laundromat_main, NULL); | 3214 | INIT_WORK(&laundromat_work,laundromat_main, NULL); |
3214 | schedule_delayed_work(&laundromat_work, NFSD_LEASE_TIME*HZ); | 3215 | laundry_wq = create_singlethread_workqueue("nfsd4"); |
3216 | queue_delayed_work(laundry_wq, &laundromat_work, NFSD_LEASE_TIME*HZ); | ||
3215 | } | 3217 | } |
3216 | 3218 | ||
3217 | int | 3219 | int |
@@ -3287,7 +3289,8 @@ __nfs4_state_shutdown(void) | |||
3287 | } | 3289 | } |
3288 | 3290 | ||
3289 | cancel_delayed_work(&laundromat_work); | 3291 | cancel_delayed_work(&laundromat_work); |
3290 | flush_scheduled_work(); | 3292 | flush_workqueue(laundry_wq); |
3293 | destroy_workqueue(laundry_wq); | ||
3291 | nfs4_init = 0; | 3294 | nfs4_init = 0; |
3292 | } | 3295 | } |
3293 | 3296 | ||