From b8e8dcb521e6232c4c16eaac1aa3b38c1cbcc59f Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Tue, 12 Mar 2013 15:52:55 -0700 Subject: [PATCH] LU-2816 llite: Set RAS_INCREASE_STEP correctly RAS_INCREASE_STEP is by pages instead of by bytes. However, I found it caused performance loss by setting it to be 4MB so I set it back to 1MB. After 4MB RPC is enabled by default, more work should be done to pick up a right value of max_read_ahead_mb to maximize performance gain of 4MB RPC. Signed-off-by: Jinshan Xiong Change-Id: Ic000f266cfefc827e112e03f76cf467c73ba88ad Reviewed-on: http://review.whamcloud.com/5691 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/llite/rw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index cbd1c91..c8b0626 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -576,7 +576,13 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io, * know what the actual RPC size is. If this needs to change, it makes more * sense to tune the i_blkbits value for the file based on the OSTs it is * striped over, rather than having a constant value for all files here. */ -#define RAS_INCREASE_STEP(inode) (1UL << inode->i_blkbits) + +/* RAS_INCREASE_STEP should be (1UL << (inode->i_blkbits - CFS_PAGE_SHIFT)). + * Temprarily set RAS_INCREASE_STEP to 1MB. After 4MB RPC is enabled + * by default, this should be adjusted corresponding with max_read_ahead_mb + * and max_read_ahead_per_file_mb otherwise the readahead budget can be used + * up quickly which will affect read performance siginificantly. See LU-2816 */ +#define RAS_INCREASE_STEP(inode) (ONE_MB_BRW_SIZE >> CFS_PAGE_SHIFT) static inline int stride_io_mode(struct ll_readahead_state *ras) { -- 1.8.3.1