From 309cc2b6e7ae6672ff9744fe07735ed234a8994e Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Mon, 22 Sep 2014 11:40:48 -0700 Subject: f2fs: refactor flush_nat_entries to remove costly reorganizing ops Previously, f2fs tries to reorganize the dirty nat entries into multiple sets according to its nid ranges. This can improve the flushing nat pages, however, if there are a lot of cached nat entries, it becomes a bottleneck. This patch introduces a new set management flow by removing dirty nat list and adding a series of set operations when the nat entry becomes dirty. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'fs/f2fs/node.h') diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h index b8ba63c43b99..bd826d953c7c 100644 --- a/fs/f2fs/node.h +++ b/fs/f2fs/node.h @@ -43,6 +43,7 @@ enum { IS_CHECKPOINTED, /* is it checkpointed before? */ HAS_FSYNCED_INODE, /* is the inode fsynced before? */ HAS_LAST_FSYNC, /* has the latest node fsync mark? */ + IS_DIRTY, /* this nat entry is dirty? */ }; struct nat_entry { @@ -60,10 +61,6 @@ struct nat_entry { #define nat_get_version(nat) (nat->ni.version) #define nat_set_version(nat, v) (nat->ni.version = v) -#define __set_nat_cache_dirty(nm_i, ne) \ - list_move_tail(&ne->list, &nm_i->dirty_nat_entries); -#define __clear_nat_cache_dirty(nm_i, ne) \ - list_move_tail(&ne->list, &nm_i->nat_entries); #define inc_node_version(version) (++version) static inline void set_nat_flag(struct nat_entry *ne, @@ -113,9 +110,9 @@ enum mem_type { }; struct nat_entry_set { - struct list_head set_list; /* link with all nat sets */ + struct list_head set_list; /* link with other nat sets */ struct list_head entry_list; /* link with dirty nat entries */ - nid_t start_nid; /* start nid of nats in set */ + nid_t set; /* set number*/ unsigned int entry_cnt; /* the # of nat entries in set */ }; -- cgit v1.2.3