From 82d485c9b47a2eb15784ccbfca9d656aff81f518 Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Mon, 5 May 2014 15:09:43 -0700 Subject: [PATCH 1/1] LU-5010 llite: disable readahead optimization There exists a race between readahead lock matching and lock cancellation, where it's difficult to discard pages from radix tree if readahead process keeps adding pages. This issue is introduced in patch http://review.whamcloud.com/8523 here I'm going to disable it. The optimization will be added back in later patch. Signed-off-by: Jinshan Xiong Change-Id: Ifa729bfc4404ac287d4af3a88ead4790218817f8 Reviewed-on: http://review.whamcloud.com/10220 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- lustre/llite/rw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index ef26a13..355d07e 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -332,8 +332,11 @@ static int cl_read_ahead_page(const struct lu_env *env, struct cl_io *io, if (!cp->cpg_defer_uptodate && !PageUptodate(vmpage)) { CDEBUG(D_READA, "page index %lu, max_index: %lu\n", ccc_index(cp), *max_index); - if (*max_index == 0 || ccc_index(cp) > *max_index) - rc = cl_page_is_under_lock(env, io, page, max_index); + /* Disable the optimization on prefetching maximum readahead + * index because there is a race with lock cancellation. This + * optimization will be revived later. + * if (*max_index == 0 || ccc_index(cp) > *max_index) */ + rc = cl_page_is_under_lock(env, io, page, max_index); if (rc == 0) { cp->cpg_defer_uptodate = 1; cp->cpg_ra_used = 0; -- 1.8.3.1