]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Reserve revoke credits for freed blocks
authorJan Kara <jack@suse.cz>
Tue, 5 Nov 2019 16:44:29 +0000 (17:44 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 5 Nov 2019 21:00:49 +0000 (16:00 -0500)
commite4ae6793d36c7b93501fe2a6765a3e358564d81d
tree1565589f99ab6ca22e94e2167c21b94934ab8ce3
parent98ae62497f7cceb17d643a603dc0886b96ab4b43
ext4: Reserve revoke credits for freed blocks

So far we have reserved only relatively high fixed amount of revoke
credits for each transaction. We over-reserved by large amount for most
cases but when freeing large directories or files with data journalling,
the fixed amount is not enough. In fact the worst case estimate is
inconveniently large (maximum extent size) for freeing of one extent.

We fix this by doing proper estimate of the amount of blocks that need
to be revoked when removing blocks from the inode due to truncate or
hole punching and otherwise reserve just a small amount of revoke
credits for each transaction to accommodate freeing of xattrs block or
so.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191105164437.32602-23-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/ext4_jbd2.c
fs/ext4/ext4_jbd2.h
fs/ext4/extents.c
fs/ext4/ialloc.c
fs/ext4/indirect.c
fs/ext4/inode.c
fs/ext4/migrate.c
fs/ext4/resize.c
fs/ext4/xattr.c
include/trace/events/ext4.h