Re: [PATCH 2/4] page_cache_readahead: remove duplicated code

From: Ram
Date: Tue Jan 25 2005 - 19:16:32 EST


On Tue, 2005-01-25 at 03:59, Oleg Nesterov wrote:
> Cases "no ahead window" and "crossed into ahead window"
> can be unified.


No. There is a reason why we had some duplication. With your patch,
we will end up reading-on-demand instead of reading ahead.

When we notice a sequential reads have resumed, we first read in the
data that is requested.
However if the read request is for more pages than what are being held
in the current window, we make the ahead window as the current window
and read in more pages in the ahead window. Doing that gives the
opportunity of always having pages in the ahead window when the next
sequential read request comes in. If we apply this patch, we will
always have to read the pages that are being requested instead of
satisfying them from the ahead window.

Ok, if this does not make it clear, here is another way of proving that
your patch does not exactly behave the way it did earlier.

With your patch you will have only one call to
block_page_cache_readahead(), when earlier there could be cases where
block_page_cache_readahead() could be called twice.

Am I am making sense?
RP


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