From owner-freebsd-hackers Mon Mar 9 10:13:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA23589 for freebsd-hackers-outgoing; Mon, 9 Mar 1998 10:13:05 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA23566; Mon, 9 Mar 1998 10:12:52 -0800 (PST) (envelope-from dyson@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.8/8.8.8) id NAA03857; Mon, 9 Mar 1998 13:12:33 -0500 (EST) (envelope-from dyson) Message-Id: <199803091812.NAA03857@dyson.iquest.net> Subject: Re: VM/Buffer cache sizing... (e.g. for serving NFS) In-Reply-To: <199803090016.VAA18605@gaia.coppe.ufrj.br> from Joao Carlos Mendes Luis at "Mar 8, 98 09:16:19 pm" To: jonny@coppe.ufrj.br (Joao Carlos Mendes Luis) Date: Mon, 9 Mar 1998 13:12:27 -0500 (EST) Cc: dyson@FreeBSD.ORG, ccsanady@iastate.edu, freebsd-hackers@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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