From owner-freebsd-current@FreeBSD.ORG Wed Jul 23 18:46:14 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402201065672 for ; Wed, 23 Jul 2008 18:46:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 928B48FC27 for ; Wed, 23 Jul 2008 18:46:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m6NIk0n9049681; Wed, 23 Jul 2008 14:46:06 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 23 Jul 2008 10:50:56 -0400 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807231050.56507.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 23 Jul 2008 14:46:06 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/7798/Wed Jul 23 13:42:38 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Manjunath Ranganathaiah Subject: Re: setting memory size with hw.physmem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2008 18:46:14 -0000 On Tuesday 22 July 2008 06:35:10 pm Manjunath Ranganathaiah wrote: > On of my system with 8G of RAM running 7.0R amd64, dmesg shows memory usage as: > > usable memory = 8576397312 (8179 MB) > avail memory = 8289071104 (7905 MB) > > If I set hw.physmem tunable to 8g, dmesg shows the following > > usable memory = 7771095040 (7411 MB) > avail memory = 7507386368 (7159 MB) > > If I set hw.physmem to 8950M > > usable memory = 8565911552 (8169 MB) > avail memory = 8278892544 (7895 MB) > > if I set hw.physmem to 8999M > > usable memory = 8576397312 (8179 MB) > avail memory = 8289071104 (7905 MB) > > > Is this expected behavior? Yes. hw.physmem is really setting a "max physical address". So any physical memory above that address is ignored. Generally part of the address space in the low 4GB range is used for memio (PCI memory BARs, VGA/CGA/EGA framebuffer (0xa0000)) and isn't backed by RAM. As a result, capping hw.physmem=4g can actually result in a bit less than 4GB of usable/avail memory. > How do I increase or decrease physical memory size by 1MB? Examine your SMAP (currently only available via loader 'smap' command or from verbose boot messages) and find the max phys addr of your RAM. Then subtract 1MB from that ending address and use that for your hw.physmem setting. -- John Baldwin