aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-07-20 16:09:01 -0400
committerTejun Heo <tj@kernel.org>2010-07-22 16:58:34 -0400
commit8b8edefa2fffbff97f9eec8b70e78ae23abad1a0 (patch)
tree7f0efac8adb9c9ed7be8af63e51510954f1c51dc /include/linux
parente120153ddf8620fd0a194d301e9c5a8b28483bb5 (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 'include/linux')
-rw-r--r--include/linux/fscache-cache.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index c57db27ac861..27c8df503152 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -21,6 +21,7 @@
21#include <linux/fscache.h> 21#include <linux/fscache.h>
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/slow-work.h> 23#include <linux/slow-work.h>
24#include <linux/workqueue.h>
24 25
25#define NR_MAXCACHES BITS_PER_LONG 26#define NR_MAXCACHES BITS_PER_LONG
26 27
@@ -389,7 +390,7 @@ struct fscache_object {
389 struct fscache_cache *cache; /* cache that supplied this object */ 390 struct fscache_cache *cache; /* cache that supplied this object */
390 struct fscache_cookie *cookie; /* netfs's file/index object */ 391 struct fscache_cookie *cookie; /* netfs's file/index object */
391 struct fscache_object *parent; /* parent object */ 392 struct fscache_object *parent; /* parent object */
392 struct slow_work work; /* attention scheduling record */ 393 struct work_struct work; /* attention scheduling record */
393 struct list_head dependents; /* FIFO of dependent objects */ 394 struct list_head dependents; /* FIFO of dependent objects */
394 struct list_head dep_link; /* link in parent's dependents list */ 395 struct list_head dep_link; /* link in parent's dependents list */
395 struct list_head pending_ops; /* unstarted operations on this object */ 396 struct list_head pending_ops; /* unstarted operations on this object */
@@ -411,7 +412,7 @@ extern const char *fscache_object_states[];
411 (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ 412 (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \
412 (obj)->state >= FSCACHE_OBJECT_DYING) 413 (obj)->state >= FSCACHE_OBJECT_DYING)
413 414
414extern const struct slow_work_ops fscache_object_slow_work_ops; 415extern void fscache_object_work_func(struct work_struct *work);
415 416
416/** 417/**
417 * fscache_object_init - Initialise a cache object description 418 * fscache_object_init - Initialise a cache object description
@@ -433,7 +434,7 @@ void fscache_object_init(struct fscache_object *object,
433 spin_lock_init(&object->lock); 434 spin_lock_init(&object->lock);
434 INIT_LIST_HEAD(&object->cache_link); 435 INIT_LIST_HEAD(&object->cache_link);
435 INIT_HLIST_NODE(&object->cookie_link); 436 INIT_HLIST_NODE(&object->cookie_link);
436 vslow_work_init(&object->work, &fscache_object_slow_work_ops); 437 INIT_WORK(&object->work, fscache_object_work_func);
437 INIT_LIST_HEAD(&object->dependents); 438 INIT_LIST_HEAD(&object->dependents);
438 INIT_LIST_HEAD(&object->dep_link); 439 INIT_LIST_HEAD(&object->dep_link);
439 INIT_LIST_HEAD(&object->pending_ops); 440 INIT_LIST_HEAD(&object->pending_ops);
@@ -534,6 +535,8 @@ extern void fscache_io_error(struct fscache_cache *cache);
534extern void fscache_mark_pages_cached(struct fscache_retrieval *op, 535extern void fscache_mark_pages_cached(struct fscache_retrieval *op,
535 struct pagevec *pagevec); 536 struct pagevec *pagevec);
536 537
538extern bool fscache_object_sleep_till_congested(signed long *timeoutp);
539
537extern enum fscache_checkaux fscache_check_aux(struct fscache_object *object, 540extern enum fscache_checkaux fscache_check_aux(struct fscache_object *object,
538 const void *data, 541 const void *data,
539 uint16_t datalen); 542 uint16_t datalen);