summaryrefslogtreecommitdiff
path: root/fs/bad_inode.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2024-04-16 17:34:51 +0300
committerDavid Sterba <dsterba@suse.com>2024-05-07 22:31:07 +0300
commit2e504418e4645302c40982a64de6a6979ec5489d (patch)
tree910cb27f83742b074936b0c23b97257b65870ae2 /fs/bad_inode.c
parent433a3e01dda1d463159a9620b40ba027514f0ea5 (diff)
downloadlinux-2e504418e4645302c40982a64de6a6979ec5489d.tar.xz
btrfs: be better releasing extent maps at try_release_extent_mapping()
At try_release_extent_mapping(), called during the release folio callback (btrfs_release_folio() callchain), we don't release any extent maps in the range if the GFP flags don't allow blocking. This behaviour is exaggerated because: 1) Both searching for extent maps and removing them are not blocking operations. The only thing that it is the cond_resched() call at the end of the loop that searches for and removes extent maps; 2) We currently only operate on a single page, so for the case where block size matches the page size, we can only have one extent map, and for the case where the block size is smaller than the page size, we can have at most 16 extent maps. So it's very unlikely the cond_resched() call will ever block even in the block size smaller than page size scenario. So instead of not removing any extent maps at all in case the GFP glags don't allow blocking, keep removing extent maps while we don't need to reschedule. This makes it safe for the subpage case and for a future where we can process folios with a size larger than a page. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/bad_inode.c')
0 files changed, 0 insertions, 0 deletions