aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents_status.h
diff options
context:
space:
mode:
authorZheng Liu <wenqing.lz@taobao.com>2014-11-25 11:45:37 -0500
committerTheodore Ts'o <tytso@mit.edu>2014-11-25 11:45:37 -0500
commitedaa53cac8fd4b96ed4b8f96c4933158ff2dd337 (patch)
treef414417ca79fe9678743ea5af75bd5afb70ad8cd /fs/ext4/extents_status.h
parent2f8e0a7c6c89f850ebd5d6c0b9a08317030d1b89 (diff)
ext4: change LRU to round-robin in extent status tree shrinker
In this commit we discard the lru algorithm for inodes with extent status tree because it takes significant effort to maintain a lru list in extent status tree shrinker and the shrinker can take a long time to scan this lru list in order to reclaim some objects. We replace the lru ordering with a simple round-robin. After that we never need to keep a lru list. That means that the list needn't be sorted if the shrinker can not reclaim any objects in the first round. Cc: Andreas Dilger <adilger.kernel@dilger.ca> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents_status.h')
-rw-r--r--fs/ext4/extents_status.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h
index efd5f970b501..0e6a33e81e5f 100644
--- a/fs/ext4/extents_status.h
+++ b/fs/ext4/extents_status.h
@@ -65,14 +65,13 @@ struct ext4_es_tree {
65}; 65};
66 66
67struct ext4_es_stats { 67struct ext4_es_stats {
68 unsigned long es_stats_last_sorted;
69 unsigned long es_stats_shrunk; 68 unsigned long es_stats_shrunk;
70 unsigned long es_stats_cache_hits; 69 unsigned long es_stats_cache_hits;
71 unsigned long es_stats_cache_misses; 70 unsigned long es_stats_cache_misses;
72 u64 es_stats_scan_time; 71 u64 es_stats_scan_time;
73 u64 es_stats_max_scan_time; 72 u64 es_stats_max_scan_time;
74 struct percpu_counter es_stats_all_cnt; 73 struct percpu_counter es_stats_all_cnt;
75 struct percpu_counter es_stats_lru_cnt; 74 struct percpu_counter es_stats_shk_cnt;
76}; 75};
77 76
78extern int __init ext4_init_es(void); 77extern int __init ext4_init_es(void);
@@ -151,7 +150,7 @@ static inline void ext4_es_store_pblock_status(struct extent_status *es,
151 150
152extern int ext4_es_register_shrinker(struct ext4_sb_info *sbi); 151extern int ext4_es_register_shrinker(struct ext4_sb_info *sbi);
153extern void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi); 152extern void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi);
154extern void ext4_es_lru_add(struct inode *inode); 153extern void ext4_es_list_add(struct inode *inode);
155extern void ext4_es_lru_del(struct inode *inode); 154extern void ext4_es_list_del(struct inode *inode);
156 155
157#endif /* _EXT4_EXTENTS_STATUS_H */ 156#endif /* _EXT4_EXTENTS_STATUS_H */