posix_fadvise noreuse disables file caching

Julian Elischer julian at freebsd.org
Wed Jan 25 23:28:31 UTC 2012

On 1/25/12 8:29 AM, John Baldwin wrote:
> So I've came up with this untested patch.  It uses
> VOP_ADVISE(FADV_DONTNEED) after read(2) calls to a NOREUSE region, and
> leaves read-ahead caching enabled for NOREUSE.  FADV_DONTNEED doesn't
> do any good really for writes (it only flushes clean buffers), so I've
> left write(2) operations as using IO_DIRECT still.  Does this sound
> reasonable?

That sounds like a good solution. If people want something from write they
can do it separately. For what it's worth, I would expect NOREUSE on 
write to still do
write clustering but to free the buffer once it is written.

More information about the freebsd-current mailing list