2.5.65-mm1 Adventures

Andrew Morton kde-optimize@mail.kde.org
Thu, 20 Mar 2003 03:26:11 -0800


Alexander Kellett <lypanov@kde.org> wrote:
>
> in the last place i worked we alloced and memset'ed 
> 1mb blocks until getting a out of mem error. i'm sure 
> there is better ways though ;-)
> 

Yes, it's pretty crude but that is the most practical way.

Unmounting the filesystem which backs those files will reliably throw away
all cached objects.

2.5 kernels have the fadvise() system call so you can use
fadvise(FADV_DONTNEED) to shoot down a file's pagecache.

If you perform an O_DIRECT read from an ext2 file in the 2.4 kernel that will
shoot down all that file's pagecache.

That's about it, really.