1
0
Fork 0

ocfs2: Remove masklog ML_UPTODATE.

Remove mlog(0,...) and mlog(ML_UPTODATE,...) from
fs/ocfs2/uptodate.c and fs/ocfs2/buffer_head_io.c.

The masklog UPTODATE is removed finally.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
hifive-unleashed-5.1
Tao Ma 2011-02-24 16:22:20 +08:00
parent 15057e981a
commit d701485a62
5 changed files with 79 additions and 41 deletions

View File

@ -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)) { if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) {
mlog(ML_UPTODATE, trace_ocfs2_read_blocks_from_disk(
"bh (%llu), owner %llu not uptodate\n",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
(unsigned long long)ocfs2_metadata_cache_owner(ci)); (unsigned long long)ocfs2_metadata_cache_owner(ci));
/* We're using ignore_cache here to say /* We're using ignore_cache here to say

View File

@ -93,7 +93,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
define_mask(DLM_RECOVERY), define_mask(DLM_RECOVERY),
define_mask(AIO), define_mask(AIO),
define_mask(DLM_GLUE), define_mask(DLM_GLUE),
define_mask(UPTODATE),
define_mask(VOTE), define_mask(VOTE),
define_mask(CONN), define_mask(CONN),
define_mask(QUORUM), define_mask(QUORUM),

View File

@ -95,7 +95,6 @@
#define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */ #define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */
#define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */ #define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */
#define ML_DLM_GLUE 0x0000000000080000ULL /* ocfs2 dlm glue layer */ #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_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */
#define ML_CONN 0x0000000004000000ULL /* net connection management */ #define ML_CONN 0x0000000004000000ULL /* net connection management */
#define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */ #define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */

View File

@ -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_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_bh);
DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_read_blocks_end); DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_read_blocks_end);
@ -2688,6 +2690,46 @@ TRACE_EVENT(ocfs2_read_blocks_begin,
); );
/* End of trace events for fs/ocfs2/buffer_head_io.c. */ /* 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 */ #endif /* _TRACE_OCFS2_H */
/* This part must be outside protection */ /* This part must be outside protection */

View File

@ -54,14 +54,13 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#define MLOG_MASK_PREFIX ML_UPTODATE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
#include "inode.h" #include "inode.h"
#include "uptodate.h" #include "uptodate.h"
#include "ocfs2_trace.h"
struct ocfs2_meta_cache_item { struct ocfs2_meta_cache_item {
struct rb_node c_node; struct rb_node c_node;
@ -152,7 +151,7 @@ static unsigned int ocfs2_purge_copied_metadata_tree(struct rb_root *root)
while ((node = rb_last(root)) != NULL) { while ((node = rb_last(root)) != NULL) {
item = rb_entry(node, struct ocfs2_meta_cache_item, c_node); 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); (unsigned long long) item->c_block);
rb_erase(&item->c_node, root); rb_erase(&item->c_node, root);
@ -180,9 +179,9 @@ void ocfs2_metadata_cache_purge(struct ocfs2_caching_info *ci)
tree = !(ci->ci_flags & OCFS2_CACHE_FL_INLINE); tree = !(ci->ci_flags & OCFS2_CACHE_FL_INLINE);
to_purge = ci->ci_num_cached; to_purge = ci->ci_num_cached;
mlog(0, "Purge %u %s items from Owner %llu\n", to_purge, trace_ocfs2_metadata_cache_purge(
tree ? "array" : "tree", (unsigned long long)ocfs2_metadata_cache_owner(ci),
(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 /* 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 * initialize the cache. We do the work to free tree members
@ -249,7 +248,7 @@ static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci,
ocfs2_metadata_cache_lock(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)ocfs2_metadata_cache_owner(ci),
(unsigned long long) bh->b_blocknr, (unsigned long long) bh->b_blocknr,
!!(ci->ci_flags & OCFS2_CACHE_FL_INLINE)); !!(ci->ci_flags & OCFS2_CACHE_FL_INLINE));
@ -261,7 +260,7 @@ static int ocfs2_buffer_cached(struct ocfs2_caching_info *ci,
ocfs2_metadata_cache_unlock(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); return (index != -1) || (item != NULL);
} }
@ -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); BUG_ON(ci->ci_num_cached >= OCFS2_CACHE_INFO_MAX_ARRAY);
mlog(0, "block %llu takes position %u\n", (unsigned long long) block, trace_ocfs2_append_cache_array(
ci->ci_num_cached); (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_cache.ci_array[ci->ci_num_cached] = block;
ci->ci_num_cached++; ci->ci_num_cached++;
@ -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 rb_node **p = &ci->ci_cache.ci_tree.rb_node;
struct ocfs2_meta_cache_item *tmp; struct ocfs2_meta_cache_item *tmp;
mlog(0, "Insert block %llu num = %u\n", (unsigned long long) block, trace_ocfs2_insert_cache_tree(
ci->ci_num_cached); (unsigned long long)ocfs2_metadata_cache_owner(ci),
(unsigned long long)block, ci->ci_num_cached);
while(*p) { while(*p) {
parent = *p; parent = *p;
@ -389,7 +390,7 @@ static void ocfs2_expand_cache(struct ocfs2_caching_info *ci,
tree[i] = NULL; 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), (unsigned long long)ocfs2_metadata_cache_owner(ci),
ci->ci_flags, ci->ci_num_cached); ci->ci_flags, ci->ci_num_cached);
} }
@ -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] = struct ocfs2_meta_cache_item *tree[OCFS2_CACHE_INFO_MAX_ARRAY] =
{ NULL, }; { 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)ocfs2_metadata_cache_owner(ci),
(unsigned long long)block, expand_tree); (unsigned long long)block, expand_tree);
@ -433,7 +434,6 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci,
ocfs2_metadata_cache_lock(ci); ocfs2_metadata_cache_lock(ci);
if (ocfs2_insert_can_use_array(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 /* Ok, items were removed from the cache in between
* locks. Detect this and revert back to the fast path */ * locks. Detect this and revert back to the fast path */
ocfs2_append_cache_array(ci, block); ocfs2_append_cache_array(ci, block);
@ -490,7 +490,7 @@ void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci,
if (ocfs2_buffer_cached(ci, bh)) if (ocfs2_buffer_cached(ci, bh))
return; 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)ocfs2_metadata_cache_owner(ci),
(unsigned long long)bh->b_blocknr); (unsigned long long)bh->b_blocknr);
@ -542,8 +542,9 @@ static void ocfs2_remove_metadata_array(struct ocfs2_caching_info *ci,
BUG_ON(index >= ci->ci_num_cached); BUG_ON(index >= ci->ci_num_cached);
BUG_ON(!ci->ci_num_cached); BUG_ON(!ci->ci_num_cached);
mlog(0, "remove index %d (num_cached = %u\n", index, trace_ocfs2_remove_metadata_array(
ci->ci_num_cached); (unsigned long long)ocfs2_metadata_cache_owner(ci),
index, ci->ci_num_cached);
ci->ci_num_cached--; ci->ci_num_cached--;
@ -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, static void ocfs2_remove_metadata_tree(struct ocfs2_caching_info *ci,
struct ocfs2_meta_cache_item *item) 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); (unsigned long long)item->c_block);
rb_erase(&item->c_node, &ci->ci_cache.ci_tree); rb_erase(&item->c_node, &ci->ci_cache.ci_tree);
@ -573,10 +575,10 @@ static void ocfs2_remove_block_from_cache(struct ocfs2_caching_info *ci,
struct ocfs2_meta_cache_item *item = NULL; struct ocfs2_meta_cache_item *item = NULL;
ocfs2_metadata_cache_lock(ci); 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)ocfs2_metadata_cache_owner(ci),
(unsigned long long) block, ci->ci_num_cached, (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) { if (ci->ci_flags & OCFS2_CACHE_FL_INLINE) {
index = ocfs2_search_cache_array(ci, block); index = ocfs2_search_cache_array(ci, block);
@ -626,9 +628,6 @@ int __init init_ocfs2_uptodate_cache(void)
if (!ocfs2_uptodate_cachep) if (!ocfs2_uptodate_cachep)
return -ENOMEM; return -ENOMEM;
mlog(0, "%u inlined cache items per inode.\n",
OCFS2_CACHE_INFO_MAX_ARRAY);
return 0; return 0;
} }