Re: Buffer Cache API

Stephen C. Tweedie (sct@redhat.com)
Wed, 26 May 1999 17:26:57 +0100 (BST)


Hi,

On Sat, 22 May 1999 22:02:38 -0400 (EDT), Randy Appleton
<randy@euclid.acs.NMU.EDU> said:

> At the LinuxExpo I talked to you about an API allowing an application to
> offer advice to the kernel on expected file usage patterns, so the kernel
> might improve the buffer cache behavior. You mentioned that POSIX had a
> standard on this.

> I've searched, but have not yet found this standard. Can you offer me a
> pointer, even if it's just a person to email?

It was in a recent Usenix ;Login: edition, and it also appears on their
web site. See:

http://www.usenix.org/publications/login/standards/22.posix.html

posix_fadvise() takes the options:

{POSIX_FADV_NORMAL} No further special treatment
{POSIX_FADV_SEQUENTIAL} Expect sequential references
{POSIX_FADV_RANDOM} Expect random references
{POSIX_FADV_WILLNEED} Will need the specified range soon
{POSIX_FADV_DONTNEED} Don't need the specified range anymore
{POSIX_FADV_NOREUSE} Expect data will not be reused once accessed

and can operate on any range of any fd. The WILLNEED/DONTNEED gives
cache control (prefetch and discard) over specific address ranges, and
the others give hints about the access pattern over the entire file.

It looks like a sensible place to start.

--Stephen

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