Whamcloud - gitweb
LU-14361 statahead: add statahead advise IOCTL 25/48625/16
authorQian Yingjin <qian@ddn.com>
Thu, 22 Sep 2022 09:24:14 +0000 (05:24 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 31 Aug 2023 06:21:21 +0000 (06:21 +0000)
commit1288681bb8aa76f43af5c53ec3ef68ecc8d412d7
treecf603f6821174f6b2261c5c056efac7f1b650ca4
parente656cccbdcf3793c9a036fab265400a3ebddf5e5
LU-14361 statahead: add statahead advise IOCTL

This patch reuse ioctl(LL_IOC_LADVISE2) for statahead advise.
This allows userspace programs to advise the kernel statahead
of the order that they will be traversing a directory, so that
the client can prefetch inode attributes from the MDT, similar
to what posix_fadvise(POSIX_FADV_SEQUENTIAL) does for file data.

After patched mdtest via adding this statahead IOCTL hint, it
can support mdtest benchmark with regularized file naming format:
mdtest.$rank.$i
The usage of this statahead advise IOCTL could be as follows:
open(dir);
ioctl(dir_fd, IOC_LADVISE2, ...);
stat mdtest.0.0;
stat mdtest.0.1;
stat mdtest.0.2;
stat mdtest.0.3;
...
clsoedir(dir);

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Iac38e33bfc6d7a0b755c2646ba8053a263e3afc9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48625
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/statahead.c
lustre/lmv/lmv_obd.c
lustre/mdt/mdt_handler.c