Re: Buffer Cache API

Dan Koren (dkoren@cthulhu.engr.sgi.com)
Mon, 31 May 1999 22:45:28 -0700


"Stephen C. Tweedie" wrote:
>
> 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

And if/when you do, please don't forget that file systems need to
be able to tell the kernel how they want things to be cached no
less than do applications. :)

thx,

Dan Koren Dan.Koren@sgi.com
Engineering Manager, File Systems phone: (USA) 650-933-3678
Silicon Graphics, Inc. pager: (USA) 888-769-0874
1600 Amphiteatre Pkwy. M/S 08U-500 or dkoren_p@pager.sgi.com
Mountain View, CA 94043-1351 fax: (USA) 650-933-3542

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