]> git.proxmox.com Git - mirror_zfs.git/commit
Add Linux posix_fadvise support
authorFinix1979 <yanchongwen@hotmail.com>
Thu, 8 Sep 2022 17:29:41 +0000 (01:29 +0800)
committerGitHub <noreply@github.com>
Thu, 8 Sep 2022 17:29:41 +0000 (10:29 -0700)
commit320f0c6022e1c9bdc9063f849c6b2e4fa3b93995
tree644183a6289eaea14a99e76c386292518c07ee7a
parent380b08098edf152b1d98e4f48b9577ce44d39166
Add Linux posix_fadvise support

The purpose of this PR is to accepts fadvise ioctl from userland
to do read-ahead by demand.

It could dramatically improve sequential read performance especially
when primarycache is set to metadata or zfs_prefetch_disable is 1.

If the file is mmaped, generic_fadvise is also called for page cache
read-ahead besides dmu_prefetch.

Only POSIX_FADV_WILLNEED and POSIX_FADV_SEQUENTIAL are supported in
this PR currently.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Finix Yan <yancw@info2soft.com>
Closes #13694
15 files changed:
config/kernel-fadvise.m4 [new file with mode: 0644]
config/kernel-generic_fadvise.m4 [new file with mode: 0644]
config/kernel.m4
module/os/linux/zfs/zpl_file.c
tests/runfiles/linux.run
tests/zfs-tests/cmd/.gitignore
tests/zfs-tests/cmd/Makefile.am
tests/zfs-tests/cmd/file/file_fadvise.c [new file with mode: 0644]
tests/zfs-tests/include/commands.cfg
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/checksum/filetest_002_pos.ksh
tests/zfs-tests/tests/functional/fadvise/cleanup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/fadvise/fadvise_sequential.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/fadvise/setup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/fault/auto_spare_002_pos.ksh