]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: limit number of scanned extents in status tree shrinker
authorJan Kara <jack@suse.cz>
Tue, 25 Nov 2014 16:51:23 +0000 (11:51 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 25 Nov 2014 16:51:23 +0000 (11:51 -0500)
commit342dde6f00b17d20ee1d1b704fb03b4019ba7373
tree8338fbccf9ca744aa6da866a52de407d83818761
parentec8c0ef0a9224f01419dec39bf6f418500a489e2
ext4: limit number of scanned extents in status tree shrinker

Currently we scan extent status trees of inodes until we reclaim nr_to_scan
extents. This can however require a lot of scanning when there are lots
of delayed extents (as those cannot be reclaimed).

Change shrinker to work as shrinkers are supposed to and *scan* only
nr_to_scan extents regardless of how many extents did we actually
reclaim. We however need to be careful and avoid scanning each status
tree from the beginning - that could lead to a situation where we would
not be able to reclaim anything at all when first nr_to_scan extents in
the tree are always unreclaimable. We remember with each inode offset
where we stopped scanning and continue from there when we next come
across the inode.

Note that we also need to update places calling __es_shrink() manually
to pass reasonable nr_to_scan to have a chance of reclaiming anything and
not just 1.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/extents_status.c
fs/ext4/super.c