When a read is unaligned on both the first and last page,
the calculation used to determine count of pages for
readahead misses that we access both of those pages.
Increase the calculated count by 1 in this case.
This case is covered by the generic readahead tests added
in LU-12645.
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Idb28d300a232026a9d916d010ee8ebf209283242
Reviewed-on: https://review.whamcloud.com/35015
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
vio->vui_ra_valid = true;
vio->vui_ra_start = cl_index(obj, pos);
vio->vui_ra_count = cl_index(obj, tot + PAGE_SIZE - 1);
+ /* If both start and end are unaligned, we read one more page
+ * than the index math suggests. */
+ if (pos % PAGE_SIZE != 0 && (pos + tot) % PAGE_SIZE != 0)
+ vio->vui_ra_count++;
+
+ CDEBUG(D_READA, "tot %ld, ra_start %lu, ra_count %lu\n", tot,
+ vio->vui_ra_start, vio->vui_ra_count);
}
/* BUG: 5972 */
cancel_lru_locks osc
$LCTL set_param osc.*.rpc_stats 0
$READS -f $DIR/$tfile -s$FILE_LENGTH -b$rsize -n$nreads -t 180
+ $LCTL get_param osc.*.rpc_stats
for osc_rpc_stats in $($LCTL get_param -N osc.*.rpc_stats); do
local stats=$($LCTL get_param -n $osc_rpc_stats)
local lines=$(echo "$stats" | awk 'END {print NR;}')
local size
if [ $lines -le 20 ]; then
+ echo "continue debug"
continue
fi
for size in 1 2 4 8; do