diff options
author | David Howells <dhowells@redhat.com> | 2009-11-19 13:11:01 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-11-19 13:11:01 -0500 |
commit | 440f0affe247e9990c8f8778f1861da4fd7d5e50 (patch) | |
tree | 0012732ac8af0245005403d9a3b0a2b1209edf32 /fs/fscache/page.c | |
parent | 3bde31a4ac225cb5805be02eff6eaaf7e0766ccd (diff) |
FS-Cache: Annotate slow-work runqueue proc lines for FS-Cache work items
Annotate slow-work runqueue proc lines for FS-Cache work items. Objects
include the object ID and the state. Operations include the object ID, the
operation ID and the operation type and state.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/page.c')
-rw-r--r-- | fs/fscache/page.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 2568e0eb644f..e8bbc395cef6 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
@@ -63,14 +63,19 @@ static void fscache_end_page_write(struct fscache_cookie *cookie, struct page *p | |||
63 | static void fscache_attr_changed_op(struct fscache_operation *op) | 63 | static void fscache_attr_changed_op(struct fscache_operation *op) |
64 | { | 64 | { |
65 | struct fscache_object *object = op->object; | 65 | struct fscache_object *object = op->object; |
66 | int ret; | ||
66 | 67 | ||
67 | _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); | 68 | _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); |
68 | 69 | ||
69 | fscache_stat(&fscache_n_attr_changed_calls); | 70 | fscache_stat(&fscache_n_attr_changed_calls); |
70 | 71 | ||
71 | if (fscache_object_is_active(object) && | 72 | if (fscache_object_is_active(object)) { |
72 | object->cache->ops->attr_changed(object) < 0) | 73 | fscache_set_op_state(op, "CallFS"); |
73 | fscache_abort_object(object); | 74 | ret = object->cache->ops->attr_changed(object); |
75 | fscache_set_op_state(op, "Done"); | ||
76 | if (ret < 0) | ||
77 | fscache_abort_object(object); | ||
78 | } | ||
74 | 79 | ||
75 | _leave(""); | 80 | _leave(""); |
76 | } | 81 | } |
@@ -99,6 +104,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) | |||
99 | fscache_operation_init(op, NULL); | 104 | fscache_operation_init(op, NULL); |
100 | fscache_operation_init_slow(op, fscache_attr_changed_op); | 105 | fscache_operation_init_slow(op, fscache_attr_changed_op); |
101 | op->flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_EXCLUSIVE); | 106 | op->flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_EXCLUSIVE); |
107 | fscache_set_op_name(op, "Attr"); | ||
102 | 108 | ||
103 | spin_lock(&cookie->lock); | 109 | spin_lock(&cookie->lock); |
104 | 110 | ||
@@ -184,6 +190,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval( | |||
184 | op->start_time = jiffies; | 190 | op->start_time = jiffies; |
185 | INIT_WORK(&op->op.fast_work, fscache_retrieval_work); | 191 | INIT_WORK(&op->op.fast_work, fscache_retrieval_work); |
186 | INIT_LIST_HEAD(&op->to_do); | 192 | INIT_LIST_HEAD(&op->to_do); |
193 | fscache_set_op_name(&op->op, "Retr"); | ||
187 | return op; | 194 | return op; |
188 | } | 195 | } |
189 | 196 | ||
@@ -257,6 +264,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, | |||
257 | _leave(" = -ENOMEM"); | 264 | _leave(" = -ENOMEM"); |
258 | return -ENOMEM; | 265 | return -ENOMEM; |
259 | } | 266 | } |
267 | fscache_set_op_name(&op->op, "RetrRA1"); | ||
260 | 268 | ||
261 | spin_lock(&cookie->lock); | 269 | spin_lock(&cookie->lock); |
262 | 270 | ||
@@ -369,6 +377,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, | |||
369 | op = fscache_alloc_retrieval(mapping, end_io_func, context); | 377 | op = fscache_alloc_retrieval(mapping, end_io_func, context); |
370 | if (!op) | 378 | if (!op) |
371 | return -ENOMEM; | 379 | return -ENOMEM; |
380 | fscache_set_op_name(&op->op, "RetrRAN"); | ||
372 | 381 | ||
373 | spin_lock(&cookie->lock); | 382 | spin_lock(&cookie->lock); |
374 | 383 | ||
@@ -461,6 +470,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, | |||
461 | op = fscache_alloc_retrieval(page->mapping, NULL, NULL); | 470 | op = fscache_alloc_retrieval(page->mapping, NULL, NULL); |
462 | if (!op) | 471 | if (!op) |
463 | return -ENOMEM; | 472 | return -ENOMEM; |
473 | fscache_set_op_name(&op->op, "RetrAL1"); | ||
464 | 474 | ||
465 | spin_lock(&cookie->lock); | 475 | spin_lock(&cookie->lock); |
466 | 476 | ||
@@ -529,6 +539,8 @@ static void fscache_write_op(struct fscache_operation *_op) | |||
529 | 539 | ||
530 | _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); | 540 | _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); |
531 | 541 | ||
542 | fscache_set_op_state(&op->op, "GetPage"); | ||
543 | |||
532 | spin_lock(&cookie->lock); | 544 | spin_lock(&cookie->lock); |
533 | spin_lock(&object->lock); | 545 | spin_lock(&object->lock); |
534 | 546 | ||
@@ -559,13 +571,17 @@ static void fscache_write_op(struct fscache_operation *_op) | |||
559 | spin_unlock(&cookie->lock); | 571 | spin_unlock(&cookie->lock); |
560 | 572 | ||
561 | if (page) { | 573 | if (page) { |
574 | fscache_set_op_state(&op->op, "Store"); | ||
562 | ret = object->cache->ops->write_page(op, page); | 575 | ret = object->cache->ops->write_page(op, page); |
576 | fscache_set_op_state(&op->op, "EndWrite"); | ||
563 | fscache_end_page_write(cookie, page); | 577 | fscache_end_page_write(cookie, page); |
564 | page_cache_release(page); | 578 | page_cache_release(page); |
565 | if (ret < 0) | 579 | if (ret < 0) { |
580 | fscache_set_op_state(&op->op, "Abort"); | ||
566 | fscache_abort_object(object); | 581 | fscache_abort_object(object); |
567 | else | 582 | } else { |
568 | fscache_enqueue_operation(&op->op); | 583 | fscache_enqueue_operation(&op->op); |
584 | } | ||
569 | } | 585 | } |
570 | 586 | ||
571 | _leave(""); | 587 | _leave(""); |
@@ -634,6 +650,7 @@ int __fscache_write_page(struct fscache_cookie *cookie, | |||
634 | fscache_operation_init(&op->op, fscache_release_write_op); | 650 | fscache_operation_init(&op->op, fscache_release_write_op); |
635 | fscache_operation_init_slow(&op->op, fscache_write_op); | 651 | fscache_operation_init_slow(&op->op, fscache_write_op); |
636 | op->op.flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_WAITING); | 652 | op->op.flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_WAITING); |
653 | fscache_set_op_name(&op->op, "Write1"); | ||
637 | 654 | ||
638 | ret = radix_tree_preload(gfp & ~__GFP_HIGHMEM); | 655 | ret = radix_tree_preload(gfp & ~__GFP_HIGHMEM); |
639 | if (ret < 0) | 656 | if (ret < 0) |