[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-optimize
Subject: Re: Using madvise for ld.so
From: Andrew Morton <akpm () osdl ! org>
Date: 2004-03-17 18:21:39
Message-ID: 20040317102139.25cc3c32.akpm () osdl ! org
[Download RAW message or body]
Michael Matz <matz@kde.org> wrote:
>
> 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 ;)
True.
You want to kill all pagecache to simulate cold startup? No, we don't have
a way of doing that apart from the force-a-swapstorm approach which you're
using. That's more valid anyway, because it will also cause reclaim of the
inode and directory entry caches.
> 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?
The I/O will not be cancelled.
_______________________________________________
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