Loading fs/ocfs2/buffer_head_io.c +1 −2 Original line number Diff line number Diff line Loading @@ -247,8 +247,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, */ if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) { mlog(ML_UPTODATE, "bh (%llu), owner %llu not uptodate\n", trace_ocfs2_read_blocks_from_disk( (unsigned long long)bh->b_blocknr, (unsigned long long)ocfs2_metadata_cache_owner(ci)); /* We're using ignore_cache here to say Loading fs/ocfs2/cluster/masklog.c +0 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = { define_mask(DLM_RECOVERY), define_mask(AIO), define_mask(DLM_GLUE), define_mask(UPTODATE), define_mask(VOTE), define_mask(CONN), define_mask(QUORUM), Loading fs/ocfs2/cluster/masklog.h +0 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,6 @@ #define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */ #define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */ #define ML_DLM_GLUE 0x0000000000080000ULL /* ocfs2 dlm glue layer */ #define ML_UPTODATE 0x0000000000200000ULL /* ocfs2 caching sequence #'s */ #define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */ #define ML_CONN 0x0000000004000000ULL /* net connection management */ #define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */ Loading fs/ocfs2/ocfs2_trace.h +42 −0 Original line number Diff line number Diff line Loading @@ -2649,6 +2649,8 @@ DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_read_blocks_sync); DEFINE_OCFS2_ULL_EVENT(ocfs2_read_blocks_sync_jbd); DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_read_blocks_from_disk); DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_read_blocks_bh); DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_read_blocks_end); Loading Loading @@ -2688,6 +2690,46 @@ TRACE_EVENT(ocfs2_read_blocks_begin, ); /* End of trace events for fs/ocfs2/buffer_head_io.c. */ /* Trace events for fs/ocfs2/uptodate.c. */ DEFINE_OCFS2_ULL_EVENT(ocfs2_purge_copied_metadata_tree); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_metadata_cache_purge); DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_buffer_cached_begin); TRACE_EVENT(ocfs2_buffer_cached_end, TP_PROTO(int index, void *item), TP_ARGS(index, item), TP_STRUCT__entry( __field(int, index) __field(void *, item) ), TP_fast_assign( __entry->index = index; __entry->item = item; ), TP_printk("%d %p", __entry->index, __entry->item) ); DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_append_cache_array); DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_insert_cache_tree); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_expand_cache); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_set_buffer_uptodate); DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_set_buffer_uptodate_begin); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_remove_metadata_array); DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_remove_metadata_tree); DEFINE_OCFS2_ULL_ULL_UINT_UINT_EVENT(ocfs2_remove_block_from_cache); /* End of trace events for fs/ocfs2/uptodate.c. */ #endif /* _TRACE_OCFS2_H */ /* This part must be outside protection */ Loading fs/ocfs2/uptodate.c +36 −37 Original line number Diff line number Diff line Loading @@ -54,14 +54,13 @@ #include <linux/buffer_head.h> #include <linux/rbtree.h> #define MLOG_MASK_PREFIX ML_UPTODATE #include <cluster/masklog.h> #include "ocfs2.h" #include "inode.h" #include "uptodate.h" #include "ocfs2_trace.h" struct ocfs2_meta_cache_item { struct rb_node c_node; Loading Loading @@ -152,7 +151,7 @@ static unsigned int ocfs2_purge_copied_metadata_tree(struct rb_root *root) while ((node = rb_last(root)) != NULL) { item = rb_entry(node, struct ocfs2_meta_cache_item, c_node); mlog(0, "Purge item %llu\n", trace_ocfs2_purge_copied_metadata_tree( (unsigned long long) item->c_block); rb_erase(&item->c_node, root); Loading Loading @@ -180,9 +179,9 @@ void ocfs2_metadata_cache_purge(struct ocfs2_caching_info *ci) tree = !(ci->ci_flags & OCFS2_CACHE_FL_INLINE); to_purge = ci->ci_num_cached; mlog(0, "Purge %u %s items from Owner %llu\n", to_purge, tree ? "array" : "tree", (unsigned long long)ocfs2_metadata_cache_owner(ci)); trace_ocfs2_metadata_cache_purge( (unsigned long long)ocfs2_metadata_cache_owner(ci), to_purge, tree); /* If we're a tree, save off the root so that we can safely * initialize the cache. We do the work to free tree members Loading Loading @@ -249,7 +248,7 @@ static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci, ocfs2_metadata_cache_lock(ci); mlog(0, "Owner %llu, query block %llu (inline = %u)\n", trace_ocfs2_buffer_cached_begin( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long) bh->b_blocknr, !!(ci->ci_flags & OCFS2_CACHE_FL_INLINE)); Loading @@ -261,7 +260,7 @@ static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci, ocfs2_metadata_cache_unlock(ci); mlog(0, "index = %d, item = %p\n", index, item); trace_ocfs2_buffer_cached_end(index, item); return (index != -1) || (item != NULL); } Loading Loading @@ -306,8 +305,9 @@ static void ocfs2_append_cache_array(struct ocfs2_caching_info *ci, { BUG_ON(ci->ci_num_cached >= OCFS2_CACHE_INFO_MAX_ARRAY); mlog(0, "block %llu takes position %u\n", (unsigned long long) block, ci->ci_num_cached); trace_ocfs2_append_cache_array( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)block, ci->ci_num_cached); ci->ci_cache.ci_array[ci->ci_num_cached] = block; ci->ci_num_cached++; Loading @@ -324,8 +324,9 @@ static void __ocfs2_insert_cache_tree(struct ocfs2_caching_info *ci, struct rb_node **p = &ci->ci_cache.ci_tree.rb_node; struct ocfs2_meta_cache_item *tmp; mlog(0, "Insert block %llu num = %u\n", (unsigned long long) block, ci->ci_num_cached); trace_ocfs2_insert_cache_tree( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)block, ci->ci_num_cached); while(*p) { parent = *p; Loading Loading @@ -389,7 +390,7 @@ static void ocfs2_expand_cache(struct ocfs2_caching_info *ci, tree[i] = NULL; } mlog(0, "Expanded %llu to a tree cache: flags 0x%x, num = %u\n", trace_ocfs2_expand_cache( (unsigned long long)ocfs2_metadata_cache_owner(ci), ci->ci_flags, ci->ci_num_cached); } Loading @@ -405,7 +406,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, struct ocfs2_meta_cache_item *tree[OCFS2_CACHE_INFO_MAX_ARRAY] = { NULL, }; mlog(0, "Owner %llu, block %llu, expand = %d\n", trace_ocfs2_set_buffer_uptodate( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)block, expand_tree); Loading Loading @@ -433,7 +434,6 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, ocfs2_metadata_cache_lock(ci); if (ocfs2_insert_can_use_array(ci)) { mlog(0, "Someone cleared the tree underneath us\n"); /* Ok, items were removed from the cache in between * locks. Detect this and revert back to the fast path */ ocfs2_append_cache_array(ci, block); Loading Loading @@ -490,7 +490,7 @@ void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, if (ocfs2_buffer_cached(ci, bh)) return; mlog(0, "Owner %llu, inserting block %llu\n", trace_ocfs2_set_buffer_uptodate_begin( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)bh->b_blocknr); Loading Loading @@ -542,8 +542,9 @@ static void ocfs2_remove_metadata_array(struct ocfs2_caching_info *ci, BUG_ON(index >= ci->ci_num_cached); BUG_ON(!ci->ci_num_cached); mlog(0, "remove index %d (num_cached = %u\n", index, ci->ci_num_cached); trace_ocfs2_remove_metadata_array( (unsigned long long)ocfs2_metadata_cache_owner(ci), index, ci->ci_num_cached); ci->ci_num_cached--; Loading @@ -559,7 +560,8 @@ static void ocfs2_remove_metadata_array(struct ocfs2_caching_info *ci, static void ocfs2_remove_metadata_tree(struct ocfs2_caching_info *ci, struct ocfs2_meta_cache_item *item) { mlog(0, "remove block %llu from tree\n", trace_ocfs2_remove_metadata_tree( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)item->c_block); rb_erase(&item->c_node, &ci->ci_cache.ci_tree); Loading @@ -573,10 +575,10 @@ static void ocfs2_remove_block_from_cache(struct ocfs2_caching_info *ci, struct ocfs2_meta_cache_item *item = NULL; ocfs2_metadata_cache_lock(ci); mlog(0, "Owner %llu, remove %llu, items = %u, array = %u\n", trace_ocfs2_remove_block_from_cache( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long) block, ci->ci_num_cached, ci->ci_flags & OCFS2_CACHE_FL_INLINE); ci->ci_flags); if (ci->ci_flags & OCFS2_CACHE_FL_INLINE) { index = ocfs2_search_cache_array(ci, block); Loading Loading @@ -626,9 +628,6 @@ int __init init_ocfs2_uptodate_cache(void) if (!ocfs2_uptodate_cachep) return -ENOMEM; mlog(0, "%u inlined cache items per inode.\n", OCFS2_CACHE_INFO_MAX_ARRAY); return 0; } Loading Loading
fs/ocfs2/buffer_head_io.c +1 −2 Original line number Diff line number Diff line Loading @@ -247,8 +247,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, */ if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) { mlog(ML_UPTODATE, "bh (%llu), owner %llu not uptodate\n", trace_ocfs2_read_blocks_from_disk( (unsigned long long)bh->b_blocknr, (unsigned long long)ocfs2_metadata_cache_owner(ci)); /* We're using ignore_cache here to say Loading
fs/ocfs2/cluster/masklog.c +0 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = { define_mask(DLM_RECOVERY), define_mask(AIO), define_mask(DLM_GLUE), define_mask(UPTODATE), define_mask(VOTE), define_mask(CONN), define_mask(QUORUM), Loading
fs/ocfs2/cluster/masklog.h +0 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,6 @@ #define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */ #define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */ #define ML_DLM_GLUE 0x0000000000080000ULL /* ocfs2 dlm glue layer */ #define ML_UPTODATE 0x0000000000200000ULL /* ocfs2 caching sequence #'s */ #define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */ #define ML_CONN 0x0000000004000000ULL /* net connection management */ #define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */ Loading
fs/ocfs2/ocfs2_trace.h +42 −0 Original line number Diff line number Diff line Loading @@ -2649,6 +2649,8 @@ DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_read_blocks_sync); DEFINE_OCFS2_ULL_EVENT(ocfs2_read_blocks_sync_jbd); DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_read_blocks_from_disk); DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_read_blocks_bh); DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_read_blocks_end); Loading Loading @@ -2688,6 +2690,46 @@ TRACE_EVENT(ocfs2_read_blocks_begin, ); /* End of trace events for fs/ocfs2/buffer_head_io.c. */ /* Trace events for fs/ocfs2/uptodate.c. */ DEFINE_OCFS2_ULL_EVENT(ocfs2_purge_copied_metadata_tree); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_metadata_cache_purge); DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_buffer_cached_begin); TRACE_EVENT(ocfs2_buffer_cached_end, TP_PROTO(int index, void *item), TP_ARGS(index, item), TP_STRUCT__entry( __field(int, index) __field(void *, item) ), TP_fast_assign( __entry->index = index; __entry->item = item; ), TP_printk("%d %p", __entry->index, __entry->item) ); DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_append_cache_array); DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_insert_cache_tree); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_expand_cache); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_set_buffer_uptodate); DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_set_buffer_uptodate_begin); DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_remove_metadata_array); DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_remove_metadata_tree); DEFINE_OCFS2_ULL_ULL_UINT_UINT_EVENT(ocfs2_remove_block_from_cache); /* End of trace events for fs/ocfs2/uptodate.c. */ #endif /* _TRACE_OCFS2_H */ /* This part must be outside protection */ Loading
fs/ocfs2/uptodate.c +36 −37 Original line number Diff line number Diff line Loading @@ -54,14 +54,13 @@ #include <linux/buffer_head.h> #include <linux/rbtree.h> #define MLOG_MASK_PREFIX ML_UPTODATE #include <cluster/masklog.h> #include "ocfs2.h" #include "inode.h" #include "uptodate.h" #include "ocfs2_trace.h" struct ocfs2_meta_cache_item { struct rb_node c_node; Loading Loading @@ -152,7 +151,7 @@ static unsigned int ocfs2_purge_copied_metadata_tree(struct rb_root *root) while ((node = rb_last(root)) != NULL) { item = rb_entry(node, struct ocfs2_meta_cache_item, c_node); mlog(0, "Purge item %llu\n", trace_ocfs2_purge_copied_metadata_tree( (unsigned long long) item->c_block); rb_erase(&item->c_node, root); Loading Loading @@ -180,9 +179,9 @@ void ocfs2_metadata_cache_purge(struct ocfs2_caching_info *ci) tree = !(ci->ci_flags & OCFS2_CACHE_FL_INLINE); to_purge = ci->ci_num_cached; mlog(0, "Purge %u %s items from Owner %llu\n", to_purge, tree ? "array" : "tree", (unsigned long long)ocfs2_metadata_cache_owner(ci)); trace_ocfs2_metadata_cache_purge( (unsigned long long)ocfs2_metadata_cache_owner(ci), to_purge, tree); /* If we're a tree, save off the root so that we can safely * initialize the cache. We do the work to free tree members Loading Loading @@ -249,7 +248,7 @@ static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci, ocfs2_metadata_cache_lock(ci); mlog(0, "Owner %llu, query block %llu (inline = %u)\n", trace_ocfs2_buffer_cached_begin( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long) bh->b_blocknr, !!(ci->ci_flags & OCFS2_CACHE_FL_INLINE)); Loading @@ -261,7 +260,7 @@ static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci, ocfs2_metadata_cache_unlock(ci); mlog(0, "index = %d, item = %p\n", index, item); trace_ocfs2_buffer_cached_end(index, item); return (index != -1) || (item != NULL); } Loading Loading @@ -306,8 +305,9 @@ static void ocfs2_append_cache_array(struct ocfs2_caching_info *ci, { BUG_ON(ci->ci_num_cached >= OCFS2_CACHE_INFO_MAX_ARRAY); mlog(0, "block %llu takes position %u\n", (unsigned long long) block, ci->ci_num_cached); trace_ocfs2_append_cache_array( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)block, ci->ci_num_cached); ci->ci_cache.ci_array[ci->ci_num_cached] = block; ci->ci_num_cached++; Loading @@ -324,8 +324,9 @@ static void __ocfs2_insert_cache_tree(struct ocfs2_caching_info *ci, struct rb_node **p = &ci->ci_cache.ci_tree.rb_node; struct ocfs2_meta_cache_item *tmp; mlog(0, "Insert block %llu num = %u\n", (unsigned long long) block, ci->ci_num_cached); trace_ocfs2_insert_cache_tree( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)block, ci->ci_num_cached); while(*p) { parent = *p; Loading Loading @@ -389,7 +390,7 @@ static void ocfs2_expand_cache(struct ocfs2_caching_info *ci, tree[i] = NULL; } mlog(0, "Expanded %llu to a tree cache: flags 0x%x, num = %u\n", trace_ocfs2_expand_cache( (unsigned long long)ocfs2_metadata_cache_owner(ci), ci->ci_flags, ci->ci_num_cached); } Loading @@ -405,7 +406,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, struct ocfs2_meta_cache_item *tree[OCFS2_CACHE_INFO_MAX_ARRAY] = { NULL, }; mlog(0, "Owner %llu, block %llu, expand = %d\n", trace_ocfs2_set_buffer_uptodate( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)block, expand_tree); Loading Loading @@ -433,7 +434,6 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, ocfs2_metadata_cache_lock(ci); if (ocfs2_insert_can_use_array(ci)) { mlog(0, "Someone cleared the tree underneath us\n"); /* Ok, items were removed from the cache in between * locks. Detect this and revert back to the fast path */ ocfs2_append_cache_array(ci, block); Loading Loading @@ -490,7 +490,7 @@ void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, if (ocfs2_buffer_cached(ci, bh)) return; mlog(0, "Owner %llu, inserting block %llu\n", trace_ocfs2_set_buffer_uptodate_begin( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)bh->b_blocknr); Loading Loading @@ -542,8 +542,9 @@ static void ocfs2_remove_metadata_array(struct ocfs2_caching_info *ci, BUG_ON(index >= ci->ci_num_cached); BUG_ON(!ci->ci_num_cached); mlog(0, "remove index %d (num_cached = %u\n", index, ci->ci_num_cached); trace_ocfs2_remove_metadata_array( (unsigned long long)ocfs2_metadata_cache_owner(ci), index, ci->ci_num_cached); ci->ci_num_cached--; Loading @@ -559,7 +560,8 @@ static void ocfs2_remove_metadata_array(struct ocfs2_caching_info *ci, static void ocfs2_remove_metadata_tree(struct ocfs2_caching_info *ci, struct ocfs2_meta_cache_item *item) { mlog(0, "remove block %llu from tree\n", trace_ocfs2_remove_metadata_tree( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)item->c_block); rb_erase(&item->c_node, &ci->ci_cache.ci_tree); Loading @@ -573,10 +575,10 @@ static void ocfs2_remove_block_from_cache(struct ocfs2_caching_info *ci, struct ocfs2_meta_cache_item *item = NULL; ocfs2_metadata_cache_lock(ci); mlog(0, "Owner %llu, remove %llu, items = %u, array = %u\n", trace_ocfs2_remove_block_from_cache( (unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long) block, ci->ci_num_cached, ci->ci_flags & OCFS2_CACHE_FL_INLINE); ci->ci_flags); if (ci->ci_flags & OCFS2_CACHE_FL_INLINE) { index = ocfs2_search_cache_array(ci, block); Loading Loading @@ -626,9 +628,6 @@ int __init init_ocfs2_uptodate_cache(void) if (!ocfs2_uptodate_cachep) return -ENOMEM; mlog(0, "%u inlined cache items per inode.\n", OCFS2_CACHE_INFO_MAX_ARRAY); return 0; } Loading