From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 2 12:39:32 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7BAA16D for ; Tue, 2 Jul 2013 12:39:32 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id 359581AAE for ; Tue, 2 Jul 2013 12:39:32 +0000 (UTC) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1Utzkq-000Jin-Ig for freebsd-hackers@freebsd.org; Tue, 02 Jul 2013 15:32:20 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.3 To: freebsd-hackers Subject: hw.physmem/hw.realmem question Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 02 Jul 2013 15:32:20 +0300 From: Daniel Braniss Message-ID: X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 12:39:32 -0000 Hi, to run some tests, I reduced the physical memory by setting hw.physmem, which got me to do some comparisons, and the more I looked around the more confused I got. for example, this host has has 32G of physical memory from dmesg: Copyright (c) 1992-2013 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.1-STABLE #26: Thu Jun 20 16:00:00 IDT 2013 danny@rnd:/home/obj/rnd/r+d/stable/9/sys/HUJI amd64 gcc version 4.2.1 20070831 patched [FreeBSD] CPU: Intel(R) Xeon(R) CPU E5-2643 0 @ 3.30GHz (3300.06-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x206d7 Family = 0x6 Model = 0x2d Stepping = 7 Features=0xbfebfbff Features2=0x1fbee3ff AMD Features=0x2c100800 AMD Features2=0x1 TSC: P-state invariant, performance statistics real memory = 34359738368 (32768 MB) avail memory = 32191340544 (30700 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: and from sysctl: hw.physmem: 34284916736 hw.usermem: 32964923392 hw.realmem: 36507222016 after setting hw.physmem=16G from dmesg: real memory = 34359738368 (32768 MB) avail memory = 13999382528 (13350 MB) and sysctl: hw.physmem: 14957563904 hw.usermem: 10094678016 hw.realmem: 17179869184 from the numbers, I can assume that realmem is the real physical memory, (or whatever is set in hw.physmem), if so, where did almost 2G go? (realmem - physmen) the only info I found so far is: from loader(8): hw.physmem Limit the amount of physical memory the system will use. By default the size is in bytes, but the k, K, m, M, g and G suffixes are also accepted and indicate kilobytes, megabytes and gigabytes respectively. An invalid suffix will result in the variable being ignored by the kernel. what is physmem and realmem, and what's the relationship - if any - between them? cheers, danny