Whamcloud - gitweb
LU-9214 llite: enable readahead for small read_ahead_per_file 96/25996/7
authorErich Focht <efocht@hpce.nec.com>
Wed, 15 Mar 2017 09:51:29 +0000 (10:51 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 30 Sep 2017 04:41:04 +0000 (04:41 +0000)
Fixes for a regression introduced by http://review.whamcloud.com/19368
for the case that max_read_ahead_per_file_mb is smaller than
max_pages_per_rpc. With 16MB RPCs this happens pretty easily. In that
case the readahead window stayed zero and the backend saw only
requests of the size of the user IOs.

This patch restores the previous behavior for this corner case while
keeping the fix for large RPCs introduced by the alignment. When
max_read_ahead_per_file_mb is smaller than max_pages_per_rpc the
RPC size will not be optimal, but will be at least 1MB and the
readahead window will be as large as expected instead of zero.

Change-Id: Ie8f4da90da56439fd1466844c6db877849adea82
Signed-off-by: Erich Focht <efocht@hpce.nec.com>
Reviewed-on: https://review.whamcloud.com/25996
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/rw.c

index c08c519..0b0b0c2 100644 (file)
@@ -713,7 +713,10 @@ static void ras_increase_window(struct inode *inode,
 
                wlen = min(ras->ras_window_len + ras->ras_rpc_size,
                           ra->ra_max_pages_per_file);
-               ras->ras_window_len = ras_align(ras, wlen, NULL);
+               if (wlen < ras->ras_rpc_size)
+                       ras->ras_window_len = wlen;
+               else
+                       ras->ras_window_len = ras_align(ras, wlen, NULL);
        }
 }