summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
authoryangerkun <yangerkun@huawei.com>2024-08-17 10:55:10 +0200
committerTheodore Ts'o <tytso@mit.edu>2024-09-02 22:11:24 +0200
commit20cee68f5b44fdc2942d20f3172a262ec247b117 (patch)
tree1e043d6740412b71ee9dde0483f2a93a7a4b407a /fs/ext4/ialloc.c
parentext4: drop all delonly descriptions (diff)
downloadlinux-20cee68f5b44fdc2942d20f3172a262ec247b117.tar.xz
linux-20cee68f5b44fdc2942d20f3172a262ec247b117.zip
ext4: clear EXT4_GROUP_INFO_WAS_TRIMMED_BIT even mount with discard
Commit 3d56b8d2c74c ("ext4: Speed up FITRIM by recording flags in ext4_group_info") speed up fstrim by skipping trim trimmed group. We also has the chance to clear trimmed once there exists some block free for this group(mount without discard), and the next trim for this group will work well too. For mount with discard, we will issue dicard when we free blocks, so leave trimmed flag keep alive to skip useless trim trigger from userspace seems reasonable. But for some case like ext4 build on dm-thinpool(ext4 blocksize 4K, pool blocksize 128K), discard from ext4 maybe unaligned for dm thinpool, and thinpool will just finish this discard(see process_discard_bio when begein equals to end) without actually process discard. For this case, trim from userspace can really help us to free some thinpool block. So convert to clear trimmed flag for all case no matter mounted with discard or not. Fixes: 3d56b8d2c74c ("ext4: Speed up FITRIM by recording flags in ext4_group_info") Signed-off-by: yangerkun <yangerkun@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20240817085510.2084444-1-yangerkun@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ialloc.c')
0 files changed, 0 insertions, 0 deletions