Re: Random file I/O regressions in 2.6

Andrew Morton
2004-05-04T01:16:34Z

Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>
> Andrew Morton wrote:
> > Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> >
> >>>That's one of its usage patterns. It's also supposed to detect the
> >>>fixed-sized-reads-seeking-all-over-the-place situation. In which case it's
> >>>supposed to submit correctly-sized multi-page BIOs. But it's not working
> >>>right for this workload.
> >>>
> >>>A naive solution would be to add special-case code which always does the
> >>>fixed-size readahead after a seek. Basically that's
> >>>
> >>> if (ra->next_size == -1UL)
> >>> force_page_cache_readahead(...)
> >>>
> >>
> >>I think a better solution to this case would be to ensure the
> >>readahead window is always min(size of read, some large number);
> >>
> >
> >
> > That would cause the kernel to perform lots of pointless pagecache lookups
> > when the file is already 100% cached.
> >
>
>
> That's pretty sad. You need a "preread" or something which
> sends the pages back... or uses the actor itself. readahead
> would then have to be reworked to only run off the end of
> the read window, but that is what it should be doing anyway.

Sorry, I do not understand that paragraph at all.

All forms or pagecache population need to examine the pagecache to find out
if the page is already there. This involves pagecache lookups. We want
the read code to "learn" that the requested pages are all coming from cache
and to stop doing those lookups altogether.