From owner-freebsd-arch@FreeBSD.ORG Fri Aug 1 17:28:16 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B1D837B401 for ; Fri, 1 Aug 2003 17:28:16 -0700 (PDT) Received: from franky.speednet.com.au (franky.speednet.com.au [203.57.65.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 933DF43FB1 for ; Fri, 1 Aug 2003 17:28:14 -0700 (PDT) (envelope-from andyf@speednet.com.au) Received: from hewey.af.speednet.com.au (hewey.af.speednet.com.au [203.38.96.242])h720SBDs084828; Sat, 2 Aug 2003 10:28:12 +1000 (EST) (envelope-from andyf@speednet.com.au) Received: from hewey.af.speednet.com.au (hewey.af.speednet.com.au [203.38.96.242])h720SAHT039544; Sat, 2 Aug 2003 10:28:11 +1000 (EST) (envelope-from andyf@speednet.com.au) Date: Sat, 2 Aug 2003 10:28:10 +1000 (EST) From: Andy Farkas X-X-Sender: andyf@hewey.af.speednet.com.au To: Poul-Henning Kamp In-Reply-To: <747.1059686371@critter.freebsd.dk> Message-ID: <20030802100150.H39348-100000@hewey.af.speednet.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: headsup: swap_pager.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2003 00:28:16 -0000 Poul-Henning Kamp wrote: > People who do not adjust NSWAPDEV to match their configuration spend > a lot of RAM on holding the radix bitmap which is 3/4 empty: > > critter phk> sysctl kern.malloc | grep -i swap > SWAP 2 753K 753K 2 64 > critter phk> pstat -s > Device 1K-blocks Used Avail Capacity > /dev/ad0s1b 1321312 0 1321312 0% > > This is because the radix bitmap gets allocated for the full > stripe width, but only one quarter of it is actually used. > > Another thing is that striping does not belong in the swap_pager in > the first place, we have CCD and similar pieces of code for that. I wasn't going to say anything (you can delete now) but the more I think about it, the more I think "if it aint broke, dont fix it". For a start, what do those kern.malloc numbers mean? Mine are different: # sysctl kern.malloc | grep -i swap SWAP 2 73K 137K 12 64,65536 # pstat -s Device 1K-blocks Used Avail Capacity Type /dev/ad0s1b 65536 144 65392 0% Interleaved /dev/md0 65104 0 65104 0% Interleaved /dev/md1 65104 0 65104 0% Interleaved /dev/md2 130208 0 130208 0% Interleaved Total 325952 144 325808 0% I don't understand what the concern about using "a lot of RAM" is when you yourself say that RAM is cheap. If its affecting KVA or something, then maybe NSWAPDEV should be added into GENERIC along with an explanation that tuning it saves memory. If the user^Wadmin is aware of the "problem" then she can adjust the value when she customises her kernel. Maybe it should be mentioned somewhere (sysinstall or swapctl.8) that the *size* of swap also affect the memory footprint of the kernel. The general rule is to have swap 2x RAM - do people really make huge swapfiles that never get used? My box has 512M RAM, my swapfile size is 64M and hardly used. I don't do crashdumps. Sure, developers will want crashdumps...but thats different. So I guess Im saying you could "fix" this issue but just documenting what effects swapfile metrics have on your RAM. -- :{ andyf@speednet.com.au Andy Farkas System Administrator Speednet Communications http://www.speednet.com.au/