Re: is there a user mode way to flush disk cache
From: JosephKK (joseph2k_at_lanset.com)
Date: 11/03/05
- Next message: Peter T. Breuer: "Re: is there a user mode way to flush disk cache"
- Previous message: JosephKK: "Re: calling stat on mounted USB filesystem cause crash"
- Next in thread: Peter T. Breuer: "Re: is there a user mode way to flush disk cache"
- Reply: Peter T. Breuer: "Re: is there a user mode way to flush disk cache"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 03 Nov 2005 04:33:15 GMT
Peter T. Breuer wrote:
> Eric Taylor <et2@rocketship1.com> wrote:
>
>
>> "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.
>
> Buffers contain data that is being written to disk but has not yet
> arrived on the disk. Cache contains data that is already present on
> disk, thus might be data that has either been read from or written
> to disk.
>
> If a buffer is written to disk, then it becomes cache (and can be
> usurped).
>
>
>> I have not been able to find a tutorial on how disk file caching
>> works on linux, do you know of a link?
>
> It "works" in the obvious way. The only question is what imanagement
> strategy is used. For that you have the bdflush controls on buffer
> aging and so on. I suspect there is a text on memory tuning in the
> Documentation directory of the kernel source.
>
>> 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.
>
> It is - they have different memory managers (at least, pre 2.4.10).
> The older memory manager is predictive (the control circuit uses at
> least first derivative info), and the newer is not (it's essentually
> stop-start, bang-bang or whatever one calls a square step response
> function).
>
>> 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).
>
> You are misinterpreting what you see, I think. It may well be that
> newer kernels have params set differently in terms of being more or
> less aggressive about caching versus buffering versus swapping etc,
> but that's not the fundamental thing. One can set those numbers any
> way one likes on both.
>
> Peter
Could you give me a pointer to some documentation on how to set these
parameters? I have never been able to figure out where it is.
-- JosephKK
- Next message: Peter T. Breuer: "Re: is there a user mode way to flush disk cache"
- Previous message: JosephKK: "Re: calling stat on mounted USB filesystem cause crash"
- Next in thread: Peter T. Breuer: "Re: is there a user mode way to flush disk cache"
- Reply: Peter T. Breuer: "Re: is there a user mode way to flush disk cache"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|