aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/stats.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-11-19 13:11:19 -0500
committerDavid Howells <dhowells@redhat.com>2009-11-19 13:11:19 -0500
commit5753c441889253e4323eee85f791a1d64cf08196 (patch)
tree55a0de053d0593d96e99710f978277df668412d1 /fs/fscache/stats.c
parentb34df792b4e9e311db47fad27949095d0629c197 (diff)
FS-Cache: Permit cache retrieval ops to be interrupted in the initial wait phase
Permit the operations to retrieve data from the cache or to allocate space in the cache for future writes to be interrupted whilst they're waiting for permission for the operation to proceed. Typically this wait occurs whilst the cache object is being looked up on disk in the background. If an interruption occurs, and the operation has not yet been given the go-ahead to run, the operation is dequeued and cancelled, and control returns to the read operation of the netfs routine with none of the requested pages having been read or in any way marked as known by the cache. This means that the initial wait is done interruptibly rather than uninterruptibly. In addition, extra stats values are made available to show the number of ops cancelled and the number of cache space allocations interrupted. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/stats.c')
-rw-r--r--fs/fscache/stats.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c
index 20233fb44bfd..4c07439d1307 100644
--- a/fs/fscache/stats.c
+++ b/fs/fscache/stats.c
@@ -25,6 +25,7 @@ atomic_t fscache_n_op_requeue;
25atomic_t fscache_n_op_deferred_release; 25atomic_t fscache_n_op_deferred_release;
26atomic_t fscache_n_op_release; 26atomic_t fscache_n_op_release;
27atomic_t fscache_n_op_gc; 27atomic_t fscache_n_op_gc;
28atomic_t fscache_n_op_cancelled;
28 29
29atomic_t fscache_n_attr_changed; 30atomic_t fscache_n_attr_changed;
30atomic_t fscache_n_attr_changed_ok; 31atomic_t fscache_n_attr_changed_ok;
@@ -36,6 +37,7 @@ atomic_t fscache_n_allocs;
36atomic_t fscache_n_allocs_ok; 37atomic_t fscache_n_allocs_ok;
37atomic_t fscache_n_allocs_wait; 38atomic_t fscache_n_allocs_wait;
38atomic_t fscache_n_allocs_nobufs; 39atomic_t fscache_n_allocs_nobufs;
40atomic_t fscache_n_allocs_intr;
39atomic_t fscache_n_alloc_ops; 41atomic_t fscache_n_alloc_ops;
40atomic_t fscache_n_alloc_op_waits; 42atomic_t fscache_n_alloc_op_waits;
41 43
@@ -169,11 +171,12 @@ static int fscache_stats_show(struct seq_file *m, void *v)
169 atomic_read(&fscache_n_attr_changed_nomem), 171 atomic_read(&fscache_n_attr_changed_nomem),
170 atomic_read(&fscache_n_attr_changed_calls)); 172 atomic_read(&fscache_n_attr_changed_calls));
171 173
172 seq_printf(m, "Allocs : n=%u ok=%u wt=%u nbf=%u\n", 174 seq_printf(m, "Allocs : n=%u ok=%u wt=%u nbf=%u int=%u\n",
173 atomic_read(&fscache_n_allocs), 175 atomic_read(&fscache_n_allocs),
174 atomic_read(&fscache_n_allocs_ok), 176 atomic_read(&fscache_n_allocs_ok),
175 atomic_read(&fscache_n_allocs_wait), 177 atomic_read(&fscache_n_allocs_wait),
176 atomic_read(&fscache_n_allocs_nobufs)); 178 atomic_read(&fscache_n_allocs_nobufs),
179 atomic_read(&fscache_n_allocs_intr));
177 seq_printf(m, "Allocs : ops=%u owt=%u\n", 180 seq_printf(m, "Allocs : ops=%u owt=%u\n",
178 atomic_read(&fscache_n_alloc_ops), 181 atomic_read(&fscache_n_alloc_ops),
179 atomic_read(&fscache_n_alloc_op_waits)); 182 atomic_read(&fscache_n_alloc_op_waits));
@@ -201,10 +204,11 @@ static int fscache_stats_show(struct seq_file *m, void *v)
201 atomic_read(&fscache_n_store_ops), 204 atomic_read(&fscache_n_store_ops),
202 atomic_read(&fscache_n_store_calls)); 205 atomic_read(&fscache_n_store_calls));
203 206
204 seq_printf(m, "Ops : pend=%u run=%u enq=%u\n", 207 seq_printf(m, "Ops : pend=%u run=%u enq=%u can=%u\n",
205 atomic_read(&fscache_n_op_pend), 208 atomic_read(&fscache_n_op_pend),
206 atomic_read(&fscache_n_op_run), 209 atomic_read(&fscache_n_op_run),
207 atomic_read(&fscache_n_op_enqueue)); 210 atomic_read(&fscache_n_op_enqueue),
211 atomic_read(&fscache_n_op_cancelled));
208 seq_printf(m, "Ops : dfr=%u rel=%u gc=%u\n", 212 seq_printf(m, "Ops : dfr=%u rel=%u gc=%u\n",
209 atomic_read(&fscache_n_op_deferred_release), 213 atomic_read(&fscache_n_op_deferred_release),
210 atomic_read(&fscache_n_op_release), 214 atomic_read(&fscache_n_op_release),