Using madvise for ld.so

Andrew Morton akpm at osdl.org
Tue Mar 16 21:21:28 CET 2004


Alexander Kellett <lypanov at kde.org> wrote:
>
> On Tue, 16 Mar 2004 21:00:26 +0100, Dirk Mueller <mueller at kde.org> wrote:
> > might be a stupid question, but how did you "clear the cache" ?
> 
> the usual "use memory till oom" thing (included in an earlier email iirc)
> i wish the kernel guys would sort this out which a proper solution.


In 2.6 you can run posix_fadvise(fd, start, length, POSIX_FADV_DONTNEED).

I've attached a little proggy which uses fadvise to shoot down some or all
of a file's pagecache.

This tool is maintained in ext3 CVS.  See

	http://www.zip.com.au/~akpm/linux/ext3/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fadvise.c
Type: application/octet-stream
Size: 1614 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20040316/5dcc3905/fadvise.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fadvise.h
Type: application/octet-stream
Size: 1579 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20040316/5dcc3905/fadvise-0001.obj


More information about the Kde-optimize mailing list