pcp
[Top] [All Lists]

RE: Meminfo confusion

To: "SGI-PCP" <pcp@xxxxxxxxxxx>
Subject: RE: Meminfo confusion
From: "Corey Cole" <ccole@xxxxxxxxxxxxx>
Date: Mon, 18 Feb 2002 10:40:00 -0700
Importance: Normal
In-reply-to: <3C70B24B.401F9168@xxxxxxxxxxx>
Sender: owner-pcp@xxxxxxxxxxx
While this probably isn't gonna work on every x86 machine ever made,
why not go into the DMI info in the BIOS?  Alan Cox has some GPL'd
code here: ftp://ftp.uk.linux.org/pub/linux/alan/DMI/dmidecode.c
that can look in the DMI table.  Running it on my Oracle machine comes up
with not only the total memory but even what slots are filled, whether the
RAM is single or double sided, etc.

-----Original Message-----
From: owner-pcp@xxxxxxxxxxx [mailto:owner-pcp@xxxxxxxxxxx]On Behalf Of
Martin Knoblauch
Sent: Monday, February 18, 2002 12:51 AM
To: m.knoblauch@xxxxxxxxxxx
Cc: Keith Owens; pcp@xxxxxxxxxxx
Subject: Re: Meminfo confusion


Martin Knoblauch wrote:
>
> Keith Owens wrote:
> >
> > On Mon, 18 Feb 2002 13:00:30 +1100 (EST),
> > Mark Goodwin <markgw@xxxxxxx> wrote:
> > >On Mon, 18 Feb 2002, Keith Owens wrote:
> > >
> > >> On Fri, 15 Feb 2002 10:26:09 +1100 (EST),
> > >> Mark Goodwin <markgw@xxxxxxx> wrote:
> > >> >Also notice physmem as reported in /proc/meminfo does not
> > >> >correspond to real physical mem; it's almost the same, but does
> > >> >not account for a small amount of mem reserved by the kernel.
> > >> >A way to figure out the exact amount still eludes me .. anyone know?
> > >>
> > >> ls -l /proc/kcore | awk '{printf("mem=%dM\n", ($5-4096)/1024/1024)}'
> > >>
> > >> Works for me on i386 and ia64.  Have not tried it on discontiguous
> > >> systems.  It reports what memory the kernel can see, not what the
> > >> machine has, which is exactly what we want for performance purposes.
> > >>
> > >
> > >but not what we want for reporting machine h/w inventory,
> > >as needed for the hinv.physmem PCP metric.
> > >
> > >Running this on sherman (2G RAM), this is way off:
> > >sherman 1% ls -l /proc/kcore | awk '{printf("mem=%dM\n",
($5-4096)/1024/1024)}'
> > >mem=896M
> >
> > Because sherman is running a kernel that was not compiled for highmem.
> > That restricts the kernel to 896M of physical memory, the value is
> > correct.  I will recompile sherman for highmem.
>
>  Hmm. I have seen this 896MB reporting on kernels with 1GB and more and
> HIHMEM support compiled in (as shown by "free").
>

 Oops, message did not go to the list. Monday morning caffeine
deprivation. I also, as already remarked, the kproc solution is not
giving the answer to "total physical memory". The numbers are basically
in the same ballpark at the MemTotal from meminfo.

 So far the best I have seen is "max_mapnr" (guaranteed to be in the
kernel), or the sum of all mtrr entries with write-back property (not
guaranteed to be available, older 2.4 kernels report complete nonsense).

Martin
--
------------------------------------------------------------------
Martin Knoblauch         |    email:  Martin.Knoblauch@xxxxxxxxxxx
TeraPort GmbH            |    Phone:  +49-89-510857-309
C+ITS                    |    Fax:    +49-89-510857-111
http://www.teraport.de   |    Mobile: +49-170-4904759


<Prev in Thread] Current Thread [Next in Thread>