[PATCH 4/6] readahead: context based method: remove readahead_ratio

From: Fengguang Wu
Date: Sat Jan 06 2007 - 02:28:09 EST


The context based readahead is pretty conservative by nature,
so do not apply readahead_ratio here.

Signed-off-by: Fengguang Wu <wfg@xxxxxxxxxxxxxxxx>

---
mm/readahead.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -1236,9 +1236,7 @@ static unsigned long count_history_pages
* Check the far pages coarsely.
* The enlarged count will contribute to the look-ahead size.
*/
- lookback = ra_max * (LOOKAHEAD_RATIO + 1) *
- 100 / (readahead_ratio | 1);
-
+ lookback = ra_max * LOOKAHEAD_RATIO;
for (count += ra_max; count < lookback; count += ra_max)
if (!__probe_page(mapping, offset - count))
break;
@@ -1384,7 +1382,8 @@ has_history_pages:
adjust_rala_aggressive(ra_max, &ra_size, &la_size);
ra_set_class(ra, RA_CLASS_CONTEXT_AGGRESSIVE);
} else {
- ra_size = max(ra_min, ra_size * readahead_ratio / 100);
+ if (ra_size < ra_min)
+ ra_size = ra_min;
if (!adjust_rala(ra_max, &ra_size, &la_size))
return -1;
ra_set_class(ra, RA_CLASS_CONTEXT);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/