Re: is there a user mode way to flush disk cache

From: Eric Taylor (et2_at_rocketship1.com)
Date: 10/20/05


Date: Thu, 20 Oct 2005 09:37:24 -0700


"Peter T. Breuer" wrote:

> > If the cache is not emptied, then the next series of file writes will
>
> There is no way to empty cache, except by filling buffers.
>
> > not complete quickly as the system will hang my process while it
> > does some cache flushing operations.
>
> There is no such thing as a "cache flushing operation". I think you
> have buffer and cache mixed up!

You are correct here. To me, the cache is the memory that top
says is being cached. I don't really know how this translates
into buffers, although the number that top says: buff for seems to
move up/down with the value of cached.

I have not been able to find a tutorial on how disk file caching
works on linux, do you know of a link?

But what I have found, through some testing (just writing a series
of 2 gig files and timing how long it takes) that the behavior on
2.4 vs 2.6 seems different.

On the 2.4 system, the writes go fast and the cache and number of
buff (in top) go up quickly until the amount of free mem is near zero.

On the 2.6 system, things begin to bog down when there's still 2 gigs
of free memory, and the cached value never gets more than 8gig on
a 12 gig system (while 2 gig are still free).

So, something must be different. But I will look into the journalling
parameters.

thanks



Relevant Pages

  • Re: ReadFileScatter and WriteFileGather
    ... Page-aligned page-size buffers can be passed down to bare metal without any ... One example is a DB server that must cache disk data without using the OS ... repeatedly requesting single pages each time. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Top - Mem: 119212k used
    ... AC>> meant "60+megs after excluding cache", ... AC>> This indicates 54360K in use, after excluding buffers and cache. ... AC> is the smallest window manager I could find. ... (/usr/bin/X11/xterm, not the 'fancy' xterms), and Mozilla. ...
    (comp.os.linux.misc)
  • Re: free (command) memory question
    ... > I just ran the free command and it shows as follows: ... Of the used memory 105MB is buffers and 213MB ... would assume Linux always keeps a little physical memory for buffers and ... cache, so I would expect it to start swapping before all of the additional ...
    (alt.os.linux.suse)
  • Re: Help - Memory Leak Issue with SCSI Stack on Linux
    ... > me some detailed information on how Linux buffer and cache are used and why ... extra blocks in the cache. ... As to the difference between buffers and cache, AIUI one is for stuff on ... 1020500 used and 14116 free and goes on to show 142440 KBytes of buffers ...
    (comp.os.linux.hardware)
  • Re: ReadFileScatter and WriteFileGather
    ... Page-aligned page-size buffers can be passed down to bare metal without ... contiguity of the physical memory it gets locked into that matters. ... space and give the driver a MDL describing the physical pages. ... One example is a DB server that must cache disk data without using the OS ...
    (microsoft.public.win32.programmer.kernel)