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>
This commit is contained in:
@@ -2450,15 +2450,14 @@ TRACE_EVENT(ext4_collapse_range,
|
||||
|
||||
TRACE_EVENT(ext4_es_shrink,
|
||||
TP_PROTO(struct super_block *sb, int nr_shrunk, u64 scan_time,
|
||||
int skip_precached, int nr_skipped, int retried),
|
||||
int nr_skipped, int retried),
|
||||
|
||||
TP_ARGS(sb, nr_shrunk, scan_time, skip_precached, nr_skipped, retried),
|
||||
TP_ARGS(sb, nr_shrunk, scan_time, nr_skipped, retried),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( dev_t, dev )
|
||||
__field( int, nr_shrunk )
|
||||
__field( unsigned long long, scan_time )
|
||||
__field( int, skip_precached )
|
||||
__field( int, nr_skipped )
|
||||
__field( int, retried )
|
||||
),
|
||||
@@ -2467,16 +2466,14 @@ TRACE_EVENT(ext4_es_shrink,
|
||||
__entry->dev = sb->s_dev;
|
||||
__entry->nr_shrunk = nr_shrunk;
|
||||
__entry->scan_time = div_u64(scan_time, 1000);
|
||||
__entry->skip_precached = skip_precached;
|
||||
__entry->nr_skipped = nr_skipped;
|
||||
__entry->retried = retried;
|
||||
),
|
||||
|
||||
TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu skip_precached %d "
|
||||
TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
|
||||
"nr_skipped %d retried %d",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev), __entry->nr_shrunk,
|
||||
__entry->scan_time, __entry->skip_precached,
|
||||
__entry->nr_skipped, __entry->retried)
|
||||
__entry->scan_time, __entry->nr_skipped, __entry->retried)
|
||||
);
|
||||
|
||||
#endif /* _TRACE_EXT4_H */
|
||||
|
Reference in New Issue
Block a user