From c9fe94717598b48c3d34bf42d051b76e2189ef76 Mon Sep 17 00:00:00 2001
From: wangdi <wangdi>
Date: Fri, 27 Jun 2008 17:28:18 +0000
Subject: [PATCH] Branch:b1_6 missing stride_start_offset in stride-read-ahead.
 b=16172 i=Oleg,Johann

---
 lustre/ChangeLog  |  9 +++++++++
 lustre/llite/rw.c | 15 ++++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index bd26bb7022..8f18e9d6f3 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -182,6 +182,15 @@ Description: ldiskfs error: XXX blocks in bitmap, YYY in gd
 Details    : If blocks per group is less than blocksize*8, set rest of the
 	     bitmap to 1.
 
+Severity   : major 
+Frequency  : Application do stride read on lustre 
+Bugzilla   : 16172
+Description: The read performance will drop a lot if the application does
+	     stride read.
+Details    : Because the stride_start_offset are missing in stride read-ahead,
+	     it will cause clients read a lot of unused pages in read-ahead,
+	     then the read-performance drops.
+
 -------------------------------------------------------------------------------
 
 
diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c
index b29cbf83d8..2e6a71ffdb 100644
--- a/lustre/llite/rw.c
+++ b/lustre/llite/rw.c
@@ -1381,13 +1381,14 @@ static int ll_readahead(struct ll_readahead_state *ras,
                 ras->ras_next_readahead = max(end, end + 1);
                 RAS_CDEBUG(ras);
         }
-	ria.ria_start = start;
-	ria.ria_end = end;
-	/* If stride I/O mode is detected, get stride window*/
-	if (stride_io_mode(ras)) {
-		ria.ria_length = ras->ras_stride_length;
-		ria.ria_pages = ras->ras_stride_pages;
-	}
+        ria.ria_start = start;
+        ria.ria_end = end;
+        /* If stride I/O mode is detected, get stride window*/
+        if (stride_io_mode(ras)) {
+                ria.ria_stoff = ras->ras_stride_offset;
+                ria.ria_length = ras->ras_stride_length;
+                ria.ria_pages = ras->ras_stride_pages;
+        }
         spin_unlock(&ras->ras_lock);
 
         if (end == 0) {
-- 
GitLab