When doing unaligned/subpages sequential reads, and thrashing happened, it is possible that (offset == prev_page), besides the normal (offset == prev_page + 1). We do not have such problem for the state based method. Signed-off-by: Fengguang Wu --- mm/readahead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-2.6.20-rc4-mm1.orig/mm/readahead.c +++ linux-2.6.20-rc4-mm1/mm/readahead.c @@ -1618,7 +1618,7 @@ page_cache_readahead_adaptive(struct add /* * Recover from possible thrashing. */ - if (!page && offset == ra->prev_page + 1 && ra_has_index(ra, offset)) + if (!page && offset - ra->prev_page <= 1 && ra_has_index(ra, offset)) return thrashing_recovery_readahead(mapping, filp, ra, offset, ra_max); -- - 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/