diff options
author | Tejun Heo <tj@kernel.org> | 2010-07-20 16:09:01 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-07-22 16:58:34 -0400 |
commit | 8b8edefa2fffbff97f9eec8b70e78ae23abad1a0 (patch) | |
tree | 7f0efac8adb9c9ed7be8af63e51510954f1c51dc /fs/fscache/internal.h | |
parent | e120153ddf8620fd0a194d301e9c5a8b28483bb5 (diff) |
fscache: convert object to use workqueue instead of slow-work
Make fscache object state transition callbacks use workqueue instead
of slow-work. New dedicated unbound CPU workqueue fscache_object_wq
is created. get/put callbacks are renamed and modified to take
@object and called directly from the enqueue wrapper and the work
function. While at it, make all open coded instances of get/put to
use fscache_get/put_object().
* Unbound workqueue is used.
* work_busy() output is printed instead of slow-work flags in object
debugging outputs. They mean basically the same thing bit-for-bit.
* sysctl fscache.object_max_active added to control concurrency. The
default value is nr_cpus clamped between 4 and
WQ_UNBOUND_MAX_ACTIVE.
* slow_work_sleep_till_thread_needed() is replaced with fscache
private implementation fscache_object_sleep_till_congested() which
waits on fscache_object_wq congestion.
* debugfs support is dropped for now. Tracing API based debug
facility is planned to be added.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/internal.h')
-rw-r--r-- | fs/fscache/internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h index edd7434ab6e5..6e0b5fb25231 100644 --- a/fs/fscache/internal.h +++ b/fs/fscache/internal.h | |||
@@ -82,6 +82,13 @@ extern unsigned fscache_defer_lookup; | |||
82 | extern unsigned fscache_defer_create; | 82 | extern unsigned fscache_defer_create; |
83 | extern unsigned fscache_debug; | 83 | extern unsigned fscache_debug; |
84 | extern struct kobject *fscache_root; | 84 | extern struct kobject *fscache_root; |
85 | extern struct workqueue_struct *fscache_object_wq; | ||
86 | DECLARE_PER_CPU(wait_queue_head_t, fscache_object_cong_wait); | ||
87 | |||
88 | static inline bool fscache_object_congested(void) | ||
89 | { | ||
90 | return workqueue_congested(WORK_CPU_UNBOUND, fscache_object_wq); | ||
91 | } | ||
85 | 92 | ||
86 | extern int fscache_wait_bit(void *); | 93 | extern int fscache_wait_bit(void *); |
87 | extern int fscache_wait_bit_interruptible(void *); | 94 | extern int fscache_wait_bit_interruptible(void *); |