From: Erich Focht Date: Wed, 15 Mar 2017 09:51:29 +0000 (+0100) Subject: LU-9214 llite: enable readahead for small read_ahead_per_file X-Git-Tag: 2.10.54~15 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F25996%2F7;p=fs%2Flustre-release.git LU-9214 llite: enable readahead for small read_ahead_per_file 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 Reviewed-on: https://review.whamcloud.com/25996 Reviewed-by: Andreas Dilger Reviewed-by: Jinshan Xiong Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index c08c519..0b0b0c2 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -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); } }