The patch titled readahead: state based method - stand-alone size limit code has been removed from the -mm tree. Its filename is readahead-state-based-method-readahead-state-based-method-stand-alone-size-limit-code.patch This patch was dropped because it was folded into readahead-state-based-method.patch ------------------------------------------------------ Subject: readahead: state based method - stand-alone size limit code From: Wu Fengguang <wfg@xxxxxxxxxxxxxxxx> Separate out the readahead/lookahead sizes limiting code, and put them to stand-alone limit_rala() function. Signed-off-by: Wu Fengguang <wfg@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/readahead.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff -puN mm/readahead.c~readahead-state-based-method-readahead-state-based-method-stand-alone-size-limit-code mm/readahead.c --- devel/mm/readahead.c~readahead-state-based-method-readahead-state-based-method-stand-alone-size-limit-code 2006-06-09 01:22:45.000000000 -0700 +++ devel-akpm/mm/readahead.c 2006-06-09 01:22:45.000000000 -0700 @@ -1010,10 +1010,8 @@ static int ra_dispatch(struct file_ra_st * - @la_size stores the look-ahead size of previous request. */ static int adjust_rala(unsigned long ra_max, - unsigned long *ra_size, unsigned long *la_size) + unsigned long *ra_size, unsigned long *la_size) { - unsigned long stream_shift = *la_size; - /* * Substract the old look-ahead to get real safe size for the next * read-ahead request. @@ -1030,8 +1028,16 @@ static int adjust_rala(unsigned long ra_ */ *la_size = *ra_size / LOOKAHEAD_RATIO; + return 1; +} + +static void limit_rala(unsigned long ra_max, unsigned long la_old, + unsigned long *ra_size, unsigned long *la_size) +{ + unsigned long stream_shift; + /* - * Apply upper limits. + * Apply basic upper limits. */ if (*ra_size > ra_max) *ra_size = ra_max; @@ -1042,11 +1048,9 @@ static int adjust_rala(unsigned long ra_ * Make sure stream_shift is not too small. * (So that the next global_shift will not be too small.) */ - stream_shift += (*ra_size - *la_size); + stream_shift = la_old + (*ra_size - *la_size); if (stream_shift < *ra_size / 4) *la_size -= (*ra_size / 4 - stream_shift); - - return 1; } /* @@ -1118,13 +1122,13 @@ state_based_readahead(struct address_spa struct page *page, pgoff_t index, unsigned long req_size, unsigned long ra_max) { - unsigned long ra_old; - unsigned long ra_size; - unsigned long la_size; + unsigned long ra_old, ra_size; + unsigned long la_old, la_size; unsigned long remain_space; unsigned long growth_limit; - la_size = ra->readahead_index - index; + la_old = la_size = ra->readahead_index - index; + ra_old = ra_readahead_size(ra); ra_size = compute_thrashing_threshold(ra, &remain_space); if (page && remain_space <= la_size && la_size > 1) { @@ -1132,7 +1136,6 @@ state_based_readahead(struct address_spa return 0; } - ra_old = ra_readahead_size(ra); growth_limit = req_size; growth_limit += ra_max / 16; growth_limit += (2 + readahead_ratio / 64) * ra_old; @@ -1142,6 +1145,8 @@ state_based_readahead(struct address_spa if (!adjust_rala(growth_limit, &ra_size, &la_size)) return 0; + limit_rala(growth_limit, la_old, &ra_size, &la_size); + ra_set_class(ra, RA_CLASS_STATE); ra_set_index(ra, index, ra->readahead_index); ra_set_size(ra, ra_size, la_size); _ Patches currently in -mm which might be from wfg@xxxxxxxxxxxxxxxx are origin.patch readahead-kconfig-options.patch radixtree-introduce-radix_tree_scan_hole.patch mm-introduce-probe_page.patch mm-introduce-pg_readahead.patch readahead-add-look-ahead-support-to-__do_page_cache_readahead.patch readahead-delay-page-release-in-do_generic_mapping_read.patch readahead-insert-cond_resched-calls.patch readahead-minmax_ra_pages.patch readahead-events-accounting.patch readahead-rescue_pages.patch readahead-sysctl-parameters.patch readahead-sysctl-parameters-fix.patch readahead-min-max-sizes.patch readahead-state-based-method-aging-accounting.patch readahead-state-based-method-routines.patch readahead-state-based-method.patch readahead-state-based-method-readahead-state-based-method-stand-alone-size-limit-code.patch readahead-state-based-method-aging-accounting-readahead-kconfig-option-readahead_smooth_aging.patch readahead-context-based-method.patch readahead-context-based-method-apply-stream_shift-size-limits-to-contexta-method.patch readahead-context-based-method-fix-remain-counting.patch readahead-context-based-method-slow-start.patch readahead-initial-method-guiding-sizes.patch readahead-initial-method-guiding-sizes-aggressive-initial-sizes.patch readahead-initial-method-thrashing-guard-size.patch readahead-initial-method-expected-read-size.patch readahead-initial-method-user-recommended-size.patch readahead-initial-method.patch readahead-backward-prefetching-method.patch readahead-backward-prefetching-method-add-use-case-comment.patch readahead-seeking-reads-method.patch readahead-thrashing-recovery-method.patch readahead-call-scheme.patch readahead-call-scheme-fix-fastcall.patch readahead-call-scheme-no-fastcall-for-readahead_cache_hit.patch readahead-call-scheme-no-fastcall-for-readahead_cache_hit-kconfig-option-readahead_hit_feedback.patch readahead-laptop-mode.patch readahead-loop-case.patch readahead-nfsd-case.patch readahead-turn-on-by-default.patch readahead-debug-radix-tree-new-functions.patch readahead-debug-traces-showing-accessed-file-names.patch readahead-debug-traces-showing-read-patterns.patch readahead-remove-size-limit-on-read_ahead_kb.patch readahead-backward-prefetching-method-fix.patch readahead-remove-the-size-limit-of-max_sectors_kb-on-read_ahead_kb.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html