[lustre-devel] [PATCH 038/151] lustre: llite: enable readahead for small read_ahead_per_file

James Simmons jsimmons at infradead.org
Mon Sep 30 11:54:57 PDT 2019


From: Erich Focht <efocht at hpce.nec.com>

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.

WC-bug-id: https://jira.whamcloud.com/browse/LU-9214
Lustre-commit: 32e64eeefa7d ("LU-9214 llite: enable readahead for small read_ahead_per_file")
Signed-off-by: Erich Focht <efocht at hpce.nec.com>
Reviewed-on: https://review.whamcloud.com/25996
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong at gmail.com>
Reviewed-by: Patrick Farrell <pfarrell at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/rw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/llite/rw.c b/fs/lustre/llite/rw.c
index 32f028db..ca0b357 100644
--- a/fs/lustre/llite/rw.c
+++ b/fs/lustre/llite/rw.c
@@ -719,7 +719,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);
 	}
 }
 
-- 
1.8.3.1



More information about the lustre-devel mailing list