From: Fengguang Wu - do no extra readahead when (readahead_ratio == 1) - define readahead_hit_rate inside CONFIG_ADAPTIVE_READAHEAD ifdefs Signed-off-by: Fengguang Wu Signed-off-by: Andrew Morton --- Documentation/sysctl/vm.txt | 2 +- include/linux/mm.h | 2 +- mm/readahead.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff -puN Documentation/sysctl/vm.txt~readahead-sysctl-parameters-fix Documentation/sysctl/vm.txt --- a/Documentation/sysctl/vm.txt~readahead-sysctl-parameters-fix +++ a/Documentation/sysctl/vm.txt @@ -234,7 +234,7 @@ plenty of memory(>>2MB per reader), a bi readahead_ratio also selects the readahead logic: VALUE CODE PATH ------------------------------------------- - 0 disable readahead totally + 0 read as is, no extra readahead 1 select the stock readahead logic 2-100 select the adaptive readahead logic diff -puN include/linux/mm.h~readahead-sysctl-parameters-fix include/linux/mm.h --- a/include/linux/mm.h~readahead-sysctl-parameters-fix +++ a/include/linux/mm.h @@ -1099,7 +1099,7 @@ extern int readahead_ratio; static inline int prefer_adaptive_readahead(void) { - return readahead_ratio > 1; + return readahead_ratio != 1; } /* Do stack extension */ diff -puN mm/readahead.c~readahead-sysctl-parameters-fix mm/readahead.c --- a/mm/readahead.c~readahead-sysctl-parameters-fix +++ a/mm/readahead.c @@ -40,10 +40,10 @@ /* Set read-ahead size to ##% of the thrashing-threshold. */ int readahead_ratio = 50; EXPORT_SYMBOL_GPL(readahead_ratio); -#endif /* Readahead as long as cache hit ratio keeps above 1/##. */ int readahead_hit_rate = 0; +#endif /* CONFIG_ADAPTIVE_READAHEAD */ /* * Detailed classification of read-ahead behaviors. _