[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-optimize
Subject:    Re: Using madvise for ld.so
From:       Michael Matz <matz () kde ! org>
Date:       2004-03-17 15:31:06
Message-ID: Pine.LNX.4.58.0403171623320.26679 () wotan ! suse ! de
[Download RAW message or body]

Hi Andrew,

On Tue, 16 Mar 2004, Andrew Morton wrote:

> > On Tue, 16 Mar 2004 21:00:26 +0100, Dirk Mueller <mueller@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 is only for one file, though.  I.e. one would need to do /proc 
parsing magic to really clean the whole file cache (for all files not open 
anymore).  I think the "alloc all mem, touch all pages" approach is 
easier ;)

Which reminds me of a question I asked myself: If I open the file, fadvise 
a WILLNEED on it, all its pages are scheduled for IO.  Completion is not 
waited for.  So, if the program then exits, the file gets closed, and 
assuming that was the last ref to that inode: will the not yet completed 
IO be canceled or will it still be completed?


Ciao,
Michael.
_______________________________________________
Kde-optimize mailing list
Kde-optimize@kde.org
https://mail.kde.org/mailman/listinfo/kde-optimize
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic