lkml.org 
[lkml]   [2007]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 10/14] readahead: state based method: protect against tiny size
Move the tiny I/O size protection code from limit_rala() to
state_based_readahead().

limit_rala() is also called by context based readahead, which has its own
minimal readahead size.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
mm/readahead.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

--- linux-2.6.21-rc3-mm2.orig/mm/readahead.c
+++ linux-2.6.21-rc3-mm2/mm/readahead.c
@@ -1031,13 +1031,6 @@ static void limit_rala(unsigned long ra_
unsigned long stream_shift;

/*
- * Protect against too small I/O sizes,
- * by mapping [0, 4*min] to [min, 4*min].
- */
- if (*ra_size < 4 * MIN_RA_PAGES)
- *ra_size = MIN_RA_PAGES + *ra_size * 3 / 4;
-
- /*
* Apply basic upper limits.
*/
if (*ra_size > ra_max)
@@ -1145,6 +1138,13 @@ state_based_readahead(struct address_spa
if (!adjust_rala(&ra_size, &la_size))
goto cancel_lookahead;

+ /*
+ * Protect against too small I/O sizes,
+ * by mapping [0, 4*min] to [min, 4*min].
+ */
+ if (ra_size < 4 * MIN_RA_PAGES)
+ ra_size = MIN_RA_PAGES + ra_size * 3 / 4;
+
growth_limit = req_size;
growth_limit += ra_max / 16;
growth_limit += 2 * ra_old;
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-16 09:57    [W:1.369 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site