Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Apr 1999 13:51:04 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "John S. Dyson" <dyson@dyson.iquest.net>
Cc:        dg@root.com, hackers@freebsd.org
Subject:   Re: Directories not VMIO cached at all!
Message-ID:  <199904192051.NAA90282@apollo.backplane.com>
References:   <199904192039.PAA20464@dyson.iquest.net>

next in thread | previous in thread | raw e-mail | index | archive | help
:>     I see an advantage both ways.  Not only are we able to use the VM cache
:>     to cache directories ( and thus scale directory operations to memory ),
:>     but I don't think there is even a downside to mapping whole pages even for
:>     small directories.  The reason is simple:  When you access small 
:>     directories you tend to access specific files in said directories.  When
:>     you access specific files, there's a good chance they will be in the namei
:>     cache.  If they are in the namei cache, the VMIO mapping will not be
:>     referenced very often for most small directories which means that the
:>     VM cache will throw it away.  Hence, no waste.
:> 
:
:I cannot believe that you said that:
:	The size of the cache buffers are then up to 8X larger when using
:	a whole page instead of a 512byte buffer.  BTW, VMIO is a misnomer,
:	and I named it...  VMIO was an earlier incarnation, and some of
:	it spilled into the existant code.
:
:	Again, do a study to find out if the internal fragmentation makes
:	things worse.  Don't depend on the VM code to just "throw" things
:	away -- if you can make considered decisions instead of deferring
:	them to a policy somewhere, make the decision...
:
:John

    My concern is over the fact that the buffer cache is relatively 
    restrictive.   Things get thrown out of it very quickly due to its small
    size.  You yourself have said that one of the VM system's most important
    features was its ability to not throw away things that it may need to
    I/O back in soon.

    Well, I submit that whatever space we 'waste' by using the VM system
    to back directory information we gain by not having to re-I/O the data.

    But I truely do not believe that we are really wasting all that much
    space.  How many directories are in-use on a system at any given point?
    Now subtract the ones that are fully namei cached... now take into account
    the fact that once disassociated from its struct buf, the backing pages
    are managed on a page-by-page basis rather then on a buffer-by-buffer
    basis.  I do not think you are left with much, and what you ARE left with
    is easily managed by the VM system.

    Or, let me put it another way:  If enough directories are being cached 
    to make the wasteage theoretically significant, then enough directories
    are being cached to blow away the existing malloc buffer space and cause
    active data to be thrown away, resulting in unnecessary I/O.  Hell, the
    processes *accessing* the directories are already an order of magnitude
    larger then the storage required for the directories.  I just don't think
    we lose much by VMIOing directories.

    VM management devolves down into the art of not throwing away things
    you need -- you said it yourself.  I think this helps enormously.  

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904192051.NAA90282>