hw.physmem/hw.realmem question

Daniel Braniss danny at cs.huji.ac.il
Tue Jul 2 12:39:32 UTC 2013


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 at 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<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,
CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x1fbee3ff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,C
X16,xTPR,PDCM,PCID,DCA,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,A
VX>
  AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant, performance statistics
real memory  = 34359738368 (32768 MB)
avail memory = 32191340544 (30700 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <DELL   DCSRADON>

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





More information about the freebsd-hackers mailing list