Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 1998 13:12:27 -0500 (EST)
From:      "John S. Dyson" <dyson@FreeBSD.ORG>
To:        jonny@coppe.ufrj.br (Joao Carlos Mendes Luis)
Cc:        dyson@FreeBSD.ORG, ccsanady@iastate.edu, freebsd-hackers@FreeBSD.ORG
Subject:   Re: VM/Buffer cache sizing... (e.g. for serving NFS)
Message-ID:  <199803091812.NAA03857@dyson.iquest.net>
In-Reply-To: <199803090016.VAA18605@gaia.coppe.ufrj.br> from Joao Carlos Mendes Luis at "Mar 8, 98 09:16:19 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Joao Carlos Mendes Luis said:
> 
> Let me try to understand.  The write-back cache is has as small
> timeout, after which it starts writing.  After writing, those pages
> are sent to the write-through cache, in case they are used again.
> If you would wait for sync() or for a memory leak to start writing,
> all those writes would compete in time without need.  Also, system
> stabilty would worse because more data is kept desnecessarily in
> memory for more time.  Is this the point ?
>

Two significant issues that I can think of right now:

	1) If the write-back is full, further filling of the write-back
	   has to wait until there is space.
	2) If the write-back is all of memory, it is a problem to manage
	   efficiently, and flushing it can take lots of time.  During
	   that flush, the filesystems can be busy, with long queues.

There are various ways to implement the scheme, and I chose the one
that we use for backwards compatibility.

> 
> A question somewhat related: in top(8), what's the diffence between
> cache and buffer memory ?  I've read that active memory is also
> used for cacheing, so how can we measure if a machine would perform
> better with more memory for cacheing ?
> 
Buffer memory is relatively (not quite) constant in size.  It is sort-of
the minimum size the buffer cache can be.  Cache memory consists of memory
that is not actively used.  If your cache memory size is very small, and
you see paging activity, you will gain some by increasing your physical
memory.

In our system, there is little to distinguish between file data and programs
except that file data can use the buffer cache under certain circumstances.
Note that there is no copying between caches in any case, and all of the
copying done is virtual or logical.  We minimize the use of physical
(bcopy) type copies -- those are only evil.


-- 
John                  | Never try to teach a pig to sing,
dyson@Freebsd.org     | it just makes you look stupid,
jdyson@nc.com         | and it irritates the pig.

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?199803091812.NAA03857>