From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 28 14:09:14 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4381A1065670 for ; Thu, 28 Jun 2012 14:09:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 18F998FC0C for ; Thu, 28 Jun 2012 14:09:14 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6709EB943; Thu, 28 Jun 2012 10:09:13 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 28 Jun 2012 09:58:13 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206280958.13859.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 28 Jun 2012 10:09:13 -0400 (EDT) Cc: Ping Chen Subject: Re: distinguish between Maxmem, realmem, physmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 14:09:14 -0000 On Tuesday, June 26, 2012 3:41:10 pm Ping Chen wrote: > Hi, > I am a bit confused with all these variables defined in freebsd(especially in freebsd 6.1): Which one of this represents the real memory of a system? Say we bought a system with 4G ram, which one tells me the RAM is 4G? > > Accordign to source code: > > Maxmem ==> the highest page of phisycal address page : if I understand correctly, this is the highest page number of physical memory that is usable? > > realMem --> somehow get assigned by realmem = Maxmem: this is confuing, if they are the same, why bother a realmem variables I think realMem is legacy. > physmem --> the number of usage pages : this seems the right one extract the memory info, however, it seems system allocate portion of memory to messge buffer which makes this physmem < 4G (assume RAM is 4G) Correct. Note that the firmware can also take up part of RAM as well (e.g. to hold ACPI tables). -- John Baldwin