Commit 433a3e01 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: remove i_size restriction at try_release_extent_mapping()

Currently we don't attempt to release extent maps if the inode has an
i_size that is not greater than 16M. This condition was added way back
in 2008 by commit 70dec807 ("Btrfs: extent_io and extent_state
optimizations"), without any explanation about it. A quick chat with
Chris on slack revealed that the goal was probably to release the extent
maps for small files only when closing the inode. This however can be
harmful in case we have tons of such files being kept open for very long
periods of time, since we will consume more and more pages for extent
maps.

So remove the condition.
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 85d28830
...@@ -2402,8 +2402,7 @@ int try_release_extent_mapping(struct page *page, gfp_t mask) ...@@ -2402,8 +2402,7 @@ int try_release_extent_mapping(struct page *page, gfp_t mask)
struct extent_io_tree *io_tree = &inode->io_tree; struct extent_io_tree *io_tree = &inode->io_tree;
struct extent_map_tree *extent_tree = &inode->extent_tree; struct extent_map_tree *extent_tree = &inode->extent_tree;
if (gfpflags_allow_blocking(mask) && if (gfpflags_allow_blocking(mask)) {
page->mapping->host->i_size > SZ_16M) {
u64 len; u64 len;
while (start <= end) { while (start <= end) {
const u64 cur_gen = btrfs_get_fs_generation(inode->root->fs_info); const u64 cur_gen = btrfs_get_fs_generation(inode->root->fs_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment