Messages in this thread Patch in this message | | | Date | Sat, 27 Jan 2007 16:02:23 +0800 | From | Fengguang Wu <> | Subject | [PATCH 4/8] readahead: state based method: move readahead_ratio out of compute_thrashing_threshold() |
| |
Make compute_thrashing_threshold() a pure computing routine, by moving the readahead_ratio policy out of it.
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |