Re: Speeding up swap

James R Bruce (bruce+@andrew.cmu.edu)
Sun, 24 Oct 1999 20:51:42 -0400 (EDT)


I'm not sure how much benefit one would achieve overall with the
explicit notification, rather than two possible alternatives:

- Keeping separate caches of singly and multiply used blocks. It's
been found that until something is used three times, it often won't get
used again. So it might be a good idea to keep singly used blocks from
kicking out lots of multiply used blocks, even if they are older.

- Using a narrow linear interpolation window to predict the next read
location. Using the last three read locations can tell you if the file
is being traversed linearly pretty well. If they aren't colinear, then
the file isn't being accessed linearly.

The benefit of these is that they allow the FS to take advantage of
things the program may not even know, like moderately sized runs of
linear accesses followed by random jumps. I've heard that NTFS does
both of the above cache optimizations along with explicit hinting,
although the explicit hinting is mostly intended for memory mapped files
where the kernel can't easily get notified for each read.

The downside, of course, is added complexity that may or may not be
helpful. It might be worth trying various policies and comparing it to
explicit hints.

I haven't looked at Linux FS caching code, so please don't grill me if
it is already doing one or more of the above (though in that case
hinting probably wouldn't help much). Just thought I might throw out
some suggestions of what has been used elsewhere to address this
performance issue.

- Jim Bruce

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/