Whamcloud - gitweb
LU-16691 ldiskfs: limit length of per-inode prealloc list 81/50481/15
authorAlex Zhuravlev <bzzz@whamcloud.com>
Fri, 31 Mar 2023 05:41:07 +0000 (08:41 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Jul 2023 22:34:52 +0000 (22:34 +0000)
commitb16c9333a00802faea419dfe6fbb013c4477c9c6
tree4a9e1e321b6fa3a82f458dab62207e1b00dce337
parentbba59b1287c9cd8c30a85fafb4fd5788452bd05c
LU-16691 ldiskfs: limit length of per-inode prealloc list

In the scenario of writing sparse files, the per-inode prealloc list may
be very long, resulting in high overhead for ext4_mb_use_preallocated().
To circumvent this problem, we limit the maximum length of per-inode
prealloc list to 512 and allow users to modify it.

After patching, we observed that the sys ratio of cpu has dropped, and
the system throughput has increased significantly. We created a process
to write the sparse file, and the running time of the process on the
fixed kernel was significantly reduced, as follows:

Running time on unfixed kernel:
    # time taskset 0x01 ./sparse /data1/sparce.dat
    real    0m2.051s
    user    0m0.008s
    sys     0m2.026s

Running time on fixed kernel:
    # time taskset 0x01 ./sparse /data1/sparce.dat
    real    0m0.471s
    user    0m0.004s
    sys     0m0.395s

Link: https://lore.kernel.org/r/d7a98178-056b-6db5-6bce-4ead23f4a257@gmail.com
Signed-off-by: Chunguang Xu <brookxu@tencent.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I5e4ea3acfc07f6e69890690211bf6a34c1230979
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50481
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
ldiskfs/kernel_patches/patches/rhel8.5/ext4-limit-per-inode-preallocation-list.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel8/ext4-limit-per-inode-preallocation-list.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.2.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.3.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.4.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.5.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.6.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.7.series