Re: [resent PATCH] Re: very slow parallel read performance

Daniel Phillips
2001-08-27T20:59:51Z

On August 27, 2001 09:55 pm, Richard Gooch wrote:
> Daniel Phillips writes:
> > The quesion is, how do you know you're streaming? Some files are
> > read/written many times and some files are accessed randomly. I'm
> > trying to avoid penalizing these admittedly rarer, but still
> > important cases.
>
> I wonder if we're trying to do the impossible: an algorithm that works
> great for very different workloads, without hints from the process.

By nature, it's impossible to do optimal page replacement without being
prescient. Nonetheless, it is possible to spot some patterns and take
advantage of them.

Look at bzip if you need inspiration. I've seen it do a few bytes worse
occasionally, but on average it does the job about 20% better than gzip,
amazing.

> Shouldn't we encourage use of madvise(2) more? And if needed, add
> O_DROPBEHIND and similar flags for open(2).
>
> The application knows how it's going to use data/memory. It should
> tell the kernel so the kernel can choose the best algorithm.

The hooks are there but it's unlikely very many people will ever use them,
even if encouraged. Also, the kernel has information available to it that
the application programmer does not. For example, the kernel knows about the
current, system-wide load.

The ideal arrangement is for madvise to complement the kernel's automagic
heuristics. Bearing that in mind, I'll take care not to break it.

--
Daniel

--
Daniel