Summary: How big is the cache?

J. Porter Clark jpc at avdms8.msfc.nasa.gov
Fri Jan 18 07:41:09 AEST 1991


'Way back in December I asked this question:

>Is there a way to find out how big the disk buffer cache is in SunOS 4.1?
>I'm talking about the thing that gets flushed out during a sync().  I used
>to know how to find out back when I was working with an old System V
>release 1 machine, but SunOS looks pretty different (maybe it's not a
>constant?), and I don't remember anyway.  (I don't have source, by the
>way.)

I received only two replies and two requests for summaries.  I thought I'd
wait and see if I got any more, but it's been a month.  Maybe the answer
is too obvious.  Here are the replies:

X-From: mc%miranda.uucp at moc.Jpl.Nasa.Gov (Mike Caplinger)

There is no separate disk block cache in 4.x -- it uses a single-level
store ala Multics and so all of physical memory can be used for disk
blocks, potentially.  (This can often be a problem, but there appears to
be no way to specify only a specific amount of memory for disk I/O.)

	Mike Caplinger, ASU/Caltech Mars Observer Camera Project
	mc at moc.jpl.nasa.gov

X-From: guy at auspex.com (Guy Harris)

Yup.  Look for the "avail mem = XXX" message that the kernel prints when
booted.  That's the size of the buffer cache.

:-)

In other words, there is no "buffer cache" for data blocks from files; the
UFS and NFS file system types do "read()"s by mapping the region of the
file to be read into the kernel's address space and copying from that
region into the user's buffer.  The blocks of the file are read as a
consequence of the file system code taking page faults on the mapped-in
region; the entire page pool is available to hold those blocks, although
other pageins compete for it.

There is still a buffer cache, but it's only used for stuff like inodes,
indirect blocks, and bitmaps, for on-disk file systems.

------------------------------------------------------------------------
J. Porter Clark                       Phone: (205)544-3661
NASA Marshall Space Flight Center     FAX: (205)544-9582
Communications Systems Branch/EB33    Internet: jpc at avdms8.msfc.nasa.gov
Huntsville, AL 35812
------------------------------------------------------------------------



More information about the Comp.sys.sun mailing list