From owner-freebsd-mobile@FreeBSD.ORG Sat May 3 11:25:03 2003 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98B5337B401 for ; Sat, 3 May 2003 11:25:03 -0700 (PDT) Received: from topperwein.pennasoft.com (acs-24-154-51-127.zoominternet.net [24.154.51.127]) by mx1.FreeBSD.org (Postfix) with ESMTP id 520FA43FA3 for ; Sat, 3 May 2003 11:25:02 -0700 (PDT) (envelope-from behanna@zbzoom.net) Received: from topperwein.pennasoft.com (topperwein.pennasoft.com [192.168.168.10])h43IPLXx007086 for ; Sat, 3 May 2003 14:25:21 -0400 (EDT) (envelope-from behanna@zbzoom.net) Date: Sat, 3 May 2003 14:25:16 -0400 (EDT) From: Chris BeHanna Sender: behanna@topperwein.pennasoft.com To: freebsd-mobile@freebsd.org In-Reply-To: <20030501161119.GE10559@pir.net> Message-ID: <20030503142119.U6930@topperwein.pennasoft.com> References: <200305011136.59414.tsasser@terra.cl> <20030501161119.GE10559@pir.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: using RAM for swap X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Chris BeHanna List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2003 18:25:03 -0000 On Thu, 1 May 2003, Peter Radcliffe wrote: > Tom probably said: > > how does one put the swap partition in RAM? > > One doesn't. Swap is for when you don't have enough ram. > > > also, what is the recommended ratio of RAM to swap for freebsd? > > There really isn't one. It helps if you have at least as much swap > than ram to make sure you can get kernel crash dumps if you ever need > to, but the right amount of swap is "as least much as you need for > what you are doing on that machine". If you want to get dumps, then swap should be >= RAM+64KB. You can't get dumps with less. I've always gone by the old standard 2*RAM rule. > > i want to do this to reduce battery use on my laptop. > > You could try mounting /tmp as mfs, with something like this; > /dev/ad0s2b /tmp mfs rw,nodev,nosuid,-s=524288 0 0 That's one way, and it's good. Another way would be to stuff /var/log/cron into mfs somehow. cron is the single biggest reason why your disk would wake up (atrun goes off every few minutes, and cron wakes up once a second). Aside from that, there are some patches floating around to delay the syncer (runs every 30 seconds by default), which is the other biggest thing that will wake up your disk (of course, if you don't have any dirty pages to flush, then the syncer will do nothing). The tradeoff there is that there's a bigger window in which a crash will lose data and/or leave the file system in an inconsistent state. > Adding more physical memory can help battery life if your machine > swaps or pages a lot, but adding more swap won't. What he said. -- Chris BeHanna Software Engineer (Remove "bogus" before responding.) behanna@bogus.zbzoom.net Turning coffee into software since 1990.