From 9c4b9ba2a32343bb8fae774db4edd7cf2ef9e852 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Sat, 19 Dec 2015 10:10:29 +0800 Subject: [PATCH] LU-8683 readahead: update ras window correctly When stride-RA hit case miss, we only reset normal sequential read-ahead window, but not reset the stride IO to avoid the overhead of re-detecting stride IO. While when the normal RA window is set to not insect with the stride-RA window, when we try to increase the stride-RA window length later, the presumption does not hold. This patch resets the stride IO as well in this case. Lustre-change: http://review.whamcloud.com/17343 Lustre-commit: 88ef5af0bed93c88984c226db755d07601aef60f Signed-off-by: Bobi Jam Change-Id: Iba6e51f12ac4d00548cc99b7bd423502b754db13 Reviewed-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/23032 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Jinshan Xiong --- lustre/llite/rw.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 7ab5a39..79ca522 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -802,12 +802,19 @@ static void ras_update(struct ll_sb_info *sbi, struct inode *inode, if (ra_miss) { if (index_in_stride_window(ras, index) && stride_io_mode(ras)) { - /*If stride-RA hit cache miss, the stride dector - *will not be reset to avoid the overhead of - *redetecting read-ahead mode */ if (index != ras->ras_last_readpage + 1) ras->ras_consecutive_pages = 0; ras_reset(inode, ras, index); + + /* If stride-RA hit cache miss, the stride + * detector will not be reset to avoid the + * overhead of redetecting read-ahead mode, + * but on the condition that the stride window + * is still intersect with normal sequential + * read-ahead window. */ + if (ras->ras_window_start < + ras->ras_stride_offset) + ras_stride_reset(ras); RAS_CDEBUG(ras); } else { /* Reset both stride window and normal RA -- 1.8.3.1