From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 4 19:37:30 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D2A0106566B; Fri, 4 Mar 2011 19:37:30 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id B0FC58FC13; Fri, 4 Mar 2011 19:37:29 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id p24JCI8l023777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Mar 2011 20:12:19 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.4/8.14.4) with ESMTP id p24JC6o7096080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Mar 2011 20:12:06 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id p24JC6WR038172; Fri, 4 Mar 2011 20:12:06 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id p24JC6gh038171; Fri, 4 Mar 2011 20:12:06 +0100 (CET) (envelope-from ticso) Date: Fri, 4 Mar 2011 20:12:06 +0100 From: Bernd Walter To: Andriy Gapon Message-ID: <20110304191205.GO86812@cicely7.cicely.de> References: <4D712607.3090106@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D712607.3090106@freebsd.org> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org, Dmitry Krivenok Subject: Re: hw.physmem (loader.conf and sysctl) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2011 19:37:30 -0000 On Fri, Mar 04, 2011 at 07:48:55PM +0200, Andriy Gapon wrote: > on 04/03/2011 16:36 Dmitry Krivenok said the following: > > Hello Hackers, > > I've limited the amount of physical memory visible for my FreeBSD-8.2 by adding > > the following in loader.conf: > > > > $ cat /boot/loader.conf | grep hw.physmem > > hw.physmem="500M" > > $ > > > > However, according to sysctl, the system sees > > > > $ sysctl hw.physmem > > hw.physmem: 507445248 > > $ > > > > The difference is (500 * 2**20 - 507445248) / 2**20 == 16.0625 Mb. > > How does the system use this "hidden" memory? > > Some memory is taken by structures that describe usable pages. > There is one vm_page_t structure per each 4KB page. > I believe that that memory is excluded from physmem. hw.physmen doesn't set the physucal memory - it sets the maximum physical address. But there are unuseable addresses used for IO - e.g. the 640k-1M range and board depended PCI io-ranges. I set hw.physmem="8704M" on my 8G system to reduce memory (last bytes are declared uncacheable by broken BIOS). -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.