Whamcloud - gitweb
LU-16338 readahead: clip readahead with kms 26/49226/21
authorQian Yingjin <qian@ddn.com>
Wed, 23 Nov 2022 13:03:41 +0000 (08:03 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 28 Mar 2023 22:14:00 +0000 (22:14 +0000)
commitb33808d3aebb06cf0660baee1186b2f944d9d06d
tree9db6a8930d7c05fc192f8a171f826e76d79a50c6
parentccee6b92ec4d338f54df0ebb2e8533b870265e4b
LU-16338 readahead: clip readahead with kms

During I/O test, it found that the read-ahead pages reach 255 for
small files with only several KiB. The amount of read data reaches
more than 1MiB.
The reason is that the granted DLM extent lock is [0, EOF], which
is larger than the requested extent. During readahead, the OSC
layer will also return [0, EOF] extent which will clip into stripe
size (1MiB) regardless the actual object size.
In this patch, the readahead range is clipped to the known min
size (kms) on OSC layer during readahead. By this way, the
read-ahead data will not beyong the last page of the file.

Add sanity/101m to verify it.

This patch also fixes multiop to return successfully when reaching
EOF instead of exiting with ENODATA during read.

Test-Parameters: testlist=sanity env=ONLY=101k,ONLY_REPEAT=3
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I285e3e1d84ad06231039306106c74d775c1b0b50
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49226
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osc/osc_io.c
lustre/tests/multiop.c
lustre/tests/sanity.sh