diff options
author | Zheng Liu <wenqing.lz@taobao.com> | 2014-11-25 11:45:37 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-11-25 11:45:37 -0500 |
commit | edaa53cac8fd4b96ed4b8f96c4933158ff2dd337 (patch) | |
tree | f414417ca79fe9678743ea5af75bd5afb70ad8cd /fs/ext4/ext4.h | |
parent | 2f8e0a7c6c89f850ebd5d6c0b9a08317030d1b89 (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/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 98da4cda9d18..ab6caf55f5bf 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -878,10 +878,9 @@ struct ext4_inode_info { | |||
878 | /* extents status tree */ | 878 | /* extents status tree */ |
879 | struct ext4_es_tree i_es_tree; | 879 | struct ext4_es_tree i_es_tree; |
880 | rwlock_t i_es_lock; | 880 | rwlock_t i_es_lock; |
881 | struct list_head i_es_lru; | 881 | struct list_head i_es_list; |
882 | unsigned int i_es_all_nr; /* protected by i_es_lock */ | 882 | unsigned int i_es_all_nr; /* protected by i_es_lock */ |
883 | unsigned int i_es_lru_nr; /* protected by i_es_lock */ | 883 | unsigned int i_es_shk_nr; /* protected by i_es_lock */ |
884 | unsigned long i_touch_when; /* jiffies of last accessing */ | ||
885 | 884 | ||
886 | /* ialloc */ | 885 | /* ialloc */ |
887 | ext4_group_t i_last_alloc_group; | 886 | ext4_group_t i_last_alloc_group; |
@@ -1322,10 +1321,11 @@ struct ext4_sb_info { | |||
1322 | 1321 | ||
1323 | /* Reclaim extents from extent status tree */ | 1322 | /* Reclaim extents from extent status tree */ |
1324 | struct shrinker s_es_shrinker; | 1323 | struct shrinker s_es_shrinker; |
1325 | struct list_head s_es_lru; | 1324 | struct list_head s_es_list; |
1325 | long s_es_nr_inode; | ||
1326 | struct ext4_es_stats s_es_stats; | 1326 | struct ext4_es_stats s_es_stats; |
1327 | struct mb_cache *s_mb_cache; | 1327 | struct mb_cache *s_mb_cache; |
1328 | spinlock_t s_es_lru_lock ____cacheline_aligned_in_smp; | 1328 | spinlock_t s_es_lock ____cacheline_aligned_in_smp; |
1329 | 1329 | ||
1330 | /* Ratelimit ext4 messages. */ | 1330 | /* Ratelimit ext4 messages. */ |
1331 | struct ratelimit_state s_err_ratelimit_state; | 1331 | struct ratelimit_state s_err_ratelimit_state; |