All of lore.kernel.org
 help / color / mirror / Atom feed
* Lost memory, total memory size is not correct
@ 2004-01-19 11:22 Jürgen Urban
  2004-01-19 17:58 ` Paolo Ornati
  0 siblings, 1 reply; 3+ messages in thread
From: Jürgen Urban @ 2004-01-19 11:22 UTC (permalink / raw)
  To: linux-kernel

Hello,

I tried to get the amount of total physical memory. I looked at /proc/meminfo 
and found this line (2.4.18):

MemTotal:        30844 kB

But this is not correct the system have 32768 kB Memory. I looked at kernel 
sources and I found the variable max_mapnr. Can I use it to detect the 
correct memory size? It seems that it stores the maximum number of pages 
usable. So I can convert it with macro K() in linux/fs/proc/proc_misc.c to a 
value in kB.

But there are 1924 kB not available (32768 kB - 30844 kB). On system boot I 
get the following message:
Memory: 30780k available (960k kernel code, 392k data, 64k init, 0k highmem)
So I calculated:

1924 kB
-960 kB Kernel
- 392 kB Data
- 64 kB Init
--------------------
508 kB

There are 508 kB lost (?) memory. It seems the boot allocator is reserving 
this memory, but linux doesn't tell for what. I want to know for what the 508 
kB are. Is the kernel stack included in the 508 kB or in the 30844 kB. I 
don't think so, because the value 30844 kB isn't changing after boot. And 
every process should allocate 8 kB kernel stack.

Best Regards
Jürgen Urban

-- 
Jürgen Urban <jur@sysgo.com>
Software Engineer

SYSGO Real-Time Solutions AG
Am Pfaffenstein 14
55270 Klein-Winternheim, Germany

Telefon: +49-6136-9948-0
FAX: +49-6136-9948-10
www.sysgo.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Lost memory, total memory size is not correct
  2004-01-19 11:22 Lost memory, total memory size is not correct Jürgen Urban
@ 2004-01-19 17:58 ` Paolo Ornati
  2004-01-19 22:22   ` Mike Fedyk
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Ornati @ 2004-01-19 17:58 UTC (permalink / raw)
  To: Jürgen Urban; +Cc: linux-kernel

On Monday 19 January 2004 12:22, Jürgen Urban wrote:
> Hello,
>
> I tried to get the amount of total physical memory. I looked at
> /proc/meminfo and found this line (2.4.18):
>
> MemTotal:        30844 kB
>
> But this is not correct the system have 32768 kB Memory. I looked at
> kernel sources and I found the variable max_mapnr. Can I use it to detect
> the correct memory size? It seems that it stores the maximum number of
> pages usable. So I can convert it with macro K() in
> linux/fs/proc/proc_misc.c to a value in kB.

There are some addresses that cannot be used on PC because there is 
something mapped (for example System ROM...), you can see these regions 
doing "cat /proc/iomem".

Here there is my output:

00000000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000f0000-000fffff : System ROM
00100000-07febfff : System RAM
  00100000-00298596 : Kernel code
  00298597-00322f27 : Kernel data
07fec000-07feefff : ACPI Tables
07fef000-07ffefff : reserved
07fff000-07ffffff : ACPI Non-volatile Storage
de800000-de81ffff : Promise Technology, Inc. 20265
df000000-df0000ff : Cologne Chip Designs GmbH ISDN network controller 
[HFC-PCI]
df800000-df8000ff : Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
  df800000-df8000ff : 8139too
e0000000-e3dfffff : PCI Bus #01
  e0000000-e1ffffff : 3Dfx Interactive, Inc. Voodoo Banshee
e3f00000-e5ffffff : PCI Bus #01
  e4000000-e5ffffff : 3Dfx Interactive, Inc. Voodoo Banshee
e6000000-e7ffffff : VIA Technologies, Inc. VT8363/8365 [KT133/KM133]
ffff0000-ffffffff : reserved


Bye

-- 
	Paolo Ornati
	Linux v2.4.24


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Lost memory, total memory size is not correct
  2004-01-19 17:58 ` Paolo Ornati
@ 2004-01-19 22:22   ` Mike Fedyk
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Fedyk @ 2004-01-19 22:22 UTC (permalink / raw)
  To: Paolo Ornati; +Cc: J?rgen Urban, linux-kernel

On Mon, Jan 19, 2004 at 06:58:05PM +0100, Paolo Ornati wrote:
> On Monday 19 January 2004 12:22, J?rgen Urban wrote:
> > Hello,
> >
> > I tried to get the amount of total physical memory. I looked at
> > /proc/meminfo and found this line (2.4.18):
> >
> > MemTotal:        30844 kB
> >
> > But this is not correct the system have 32768 kB Memory. I looked at
> > kernel sources and I found the variable max_mapnr. Can I use it to detect
> > the correct memory size? It seems that it stores the maximum number of
> > pages usable. So I can convert it with macro K() in
> > linux/fs/proc/proc_misc.c to a value in kB.
> 
> There are some addresses that cannot be used on PC because there is 
> something mapped (for example System ROM...), you can see these regions 
> doing "cat /proc/iomem".

That's usually just a few KB, but don't forget that MemTotal is what's left
after kernel memory is mapped.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-19 22:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19 11:22 Lost memory, total memory size is not correct Jürgen Urban
2004-01-19 17:58 ` Paolo Ornati
2004-01-19 22:22   ` Mike Fedyk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.