[PATCH 4/8] readahead: state based method: move readahead_ratio out of compute_thrashing_threshold()

From: Fengguang Wu
Date: Sat Jan 27 2007 - 03:26:17 EST


Make compute_thrashing_threshold() a pure computing routine,
by moving the readahead_ratio policy out of it.

Signed-off-by: Fengguang Wu <wfg@xxxxxxxxxxxxxxxx>
---
mm/readahead.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.20-rc4-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc4-mm1/mm/readahead.c
@@ -1025,7 +1025,7 @@ static unsigned long compute_thrashing_t
stream_shift = ra_invoke_interval(ra);

/* future safe space */
- ll = (uint64_t) stream_shift * (global_size >> 9) * readahead_ratio * 5;
+ ll = (uint64_t) stream_shift * global_size;
do_div(ll, global_shift);
ra_size = ll;

@@ -1063,6 +1063,7 @@ state_based_readahead(struct address_spa
la_old = la_size = ra->readahead_index - offset;
ra_old = ra_readahead_size(ra);
ra_size = compute_thrashing_threshold(ra, &remain_space);
+ ra_size = ra_size * readahead_ratio / 100;

if (page && remain_space <= la_size) {
rescue_pages(page, la_size);

--
-
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/