Whamcloud - gitweb
LU-5010 llite: disable readahead optimization 20/10220/2
authorJinshan Xiong <jinshan.xiong@intel.com>
Mon, 5 May 2014 22:09:43 +0000 (15:09 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 May 2014 17:30:39 +0000 (17:30 +0000)
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 <jinshan.xiong@intel.com>
Change-Id: Ifa729bfc4404ac287d4af3a88ead4790218817f8
Reviewed-on: http://review.whamcloud.com/10220
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/rw.c

index ef26a13..355d07e 100644 (file)
@@ -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;