lkml.org 
[lkml]   [2005]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] readahead: factor out duplicated code
Steven Pratt wrote:
>
> >+static int make_ahead_window(struct address_space *mapping, struct file *filp,
> >+ struct file_ra_state *ra, int force)
> >+{
> >+ int block, ret;
> >+
> >+ block = force || (ra->prev_page >= ra->ahead_start);
> >+ ret = blockable_page_cache_readahead(mapping, filp,
> >+ ra->ahead_start, ra->ahead_size, ra, block);
> >+
> >+ if (!ret && !force) {
> >
> This really needs to be
>
> if (!ret && !block) {
>

Current code:

block = offset + newsize-1 >= ra->ahead_start;
if (!blockable_page_cache_readahead(..., block) {
ra->ahead_start = 0;
ra->ahead_size = 0;
}

Patched code:
make_ahead_window(..., 0); // force == 0

So i think the patch is correct.

> otherwise we can have an aheadwindow which was never populated which
> will cause slow reads which we want to avoid in all cases.

may be, but this patch tries not to change the current behavior.

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

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.068 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site