Skip to content

Commit 15b3b32

Browse files
fdmananakdave
authored andcommitted
btrfs: do regular iput instead of delayed iput during extent map shrinking
The extent map shrinker now runs in the system unbound workqueue and no longer in kswapd context so it can directly do an iput() on inodes even if that blocks or needs to acquire any lock (we aren't holding any locks when requesting the delayed iput from the shrinker). So we don't need to add a delayed iput, wake up the cleaner and delegate the iput() to the cleaner, which also adds extra contention on the spinlock that protects the delayed iputs list. Reported-by: Ivan Shapovalov <[email protected]> Tested-by: Ivan Shapovalov <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ CC: [email protected] # 6.12+ Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c6c9c4d commit 15b3b32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/extent_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ static long btrfs_scan_root(struct btrfs_root *root, struct btrfs_em_shrink_ctx
12561256

12571257
min_ino = btrfs_ino(inode) + 1;
12581258
fs_info->em_shrinker_last_ino = btrfs_ino(inode);
1259-
btrfs_add_delayed_iput(inode);
1259+
iput(&inode->vfs_inode);
12601260

12611261
if (ctx->scanned >= ctx->nr_to_scan || btrfs_fs_closing(fs_info))
12621262
break;

0 commit comments

Comments
 (0)