]> git.hungrycats.org Git - linux/commit
[PATCH] sync dirty pages in fadvise(FADV_DONTNEED)
authorAndrew Morton <akpm@digeo.com>
Thu, 3 Apr 2003 00:28:11 +0000 (16:28 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Apr 2003 00:28:11 +0000 (16:28 -0800)
commit3bc17e74bd49adf676fb0393f39ad32b58d8e408
tree3d8355efef1b0fcd4ca3d7de3d8b754c4c8590d4
parent89ef94951c0c8951d5cfd6fda985577d477238b5
[PATCH] sync dirty pages in fadvise(FADV_DONTNEED)

This changes the fadvise(FADV_DONTNEED) operation to start async writeout of
any dirty pages in the file.

The thinking is that if the application doesn't want to use those pages in
the future, we may as well get IO underway against them so they can be freed
up on the next call to fadvise().

The POSIX spec does not go into any detail as to whether this is the right or
wrong behaviour.

This provides a nice way for applications whihc are writing streaming data
(the main users of fadvise) to keep the amount of dirty pagecache under
control without having to resort to system-wide VM tuning.

It also provides an "async fsync()".  If the application passes in a length
of zero, fadvise will start async writeout of the pages, but will not
invalidate any of the file's pagecache.
include/linux/fs.h
mm/fadvise.c
mm/filemap.c