Re: How does disk caching work?

From: Jim C. Nasby (jim_at_nasby.net)
Date: 04/17/04

  • Next message: Aaron Seelye: "Re: command piped into bzip not using all available CPU"
    Date: Fri, 16 Apr 2004 17:12:11 -0500
    To: Igor Shmukler <shmukler@mail.ru>
    
    

    On Sat, Apr 17, 2004 at 01:56:55AM +0400, "Igor Shmukler" wrote:
    > > Is there a document anywhere that describes in detail how FreeBSD
    > > handles disk caching? I've read Matt Dillon's description of the VM
    > > system, but it deals mostly with programs, other than vague statements
    > > such as 'FreeBSD uses all available memory for disk caching'.
    >
    > Well, the statement is not vague. FreeBSD has a unified buffer cache. This means that ALL AVAILABLE
    > MEMORY IS A BUFFER CACHE for all device IO.
    >
    > > I think I know how caching memory mapped IO works for the most part,
    > > since it should be treated just like program data, but what about files
    > > that aren't memory mapped? What impact is there as pages move from
    > > active to inactive to cache to free? What role do wired and buffer pages
    > > play?
    >
    > If file is not memory mapped it is not in memory, is it? Where do you cache it? Maybe I am missing
    > somewhing? Do you maybe want to know about node caching?

    What if the file isn't memory mapped? You can access a file without
    mapping it into memory, right?

    > When pages are rotated from active to inactive and then to cache buckets they is still retains vnode
    > references. Once it is in free queue, there is no way to put it back to cache. Association is lost.
    >
    > Wired pages are to pin memory. So that we do not get situation when fault handling code is paged out.
    >
    > I am not FreeBSD guru so I never heard of BUFFER pages. Is there such a concept?

    I'm reffering to the 'Buf' column at the top of top. I remember reading
    something about that being used to cache file descriptors before the
    files are mapped into memory, but I'm not very clear on what is actually
    happening.

    -- 
    Jim C. Nasby, Database Consultant                  jim@nasby.net
    Member: Triangle Fraternity, Sports Car Club of America
    Give your computer some brain candy! www.distributed.net Team #1828
    Windows: "Where do you want to go today?"
    Linux: "Where do you want to go tomorrow?"
    FreeBSD: "Are you guys coming, or what?"
    _______________________________________________
    freebsd-performance@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-performance
    To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org"
    

  • Next message: Aaron Seelye: "Re: command piped into bzip not using all available CPU"

    Relevant Pages

    • Re: How does disk caching work?
      ... > Is there a document anywhere that describes in detail how FreeBSD ... > such as 'FreeBSD uses all available memory for disk caching'. ... MEMORY IS A BUFFER CACHE for all device IO. ...
      (freebsd-performance)
    • Re: Using multiple indices on a single table in a query
      ... Actually the caching is not done on a row by row basis. ... never read a single row into memory unless there is only 1 row on a page. ... that data in cache at the expense of more frequently used data. ...
      (microsoft.public.sqlserver.programming)
    • Re: More optimisation
      ... If I want to perform actions on several large arrays, ... The best way is to look at the memory hiearchy of the processor you are using. ... Neither method uses caching particularly well. ... The organization of the cache system can still ...
      (comp.lang.c)
    • Re: the size of the free physical memory
      ... > All unices use physical memory for IO Caching or other caching. ... > A good cache size will have a goot hit rate, ... I described how HP-UX manages physical memory. ... > The memory seems to be used more because HP-UX uses pseudo swap, ...
      (comp.sys.hp.hpux)
    • RE: Microsoft Caching Application Blocks
      ... The example they ship is extremely bad in that most of the complicated stuff in the example has to do with the Asynchronous Invocation Block, not the caching. ... When you use the in memory cache, the application block starts another thread that is responsible for managing the scavenging or expiration policy. ... RAMJEE TANGUTUR ...
      (microsoft.public.dotnet.general)