2007-01-06 07:27:08

by Wu Fengguang

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

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

Signed-off-by: Fengguang Wu <[email protected]>

---
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);

--