On Thu, May 17, 2007 at 12:56:18AM -0800, Dharmosoth Seetharam wrote:

[snip]

> >>>>>> 2) What would be the size of /proc/vmcore ??
> >>>>>>    /proc/vmcore size will be dependent on any criteria like RAM size
> >>>>>> or
> >>>>>> other ?
> >>>>> 
> >>>>> It will be (RAM Size - Reserved memory area size)
> >>>> 
> >>>> 
> >>>> /proc/vmcore size ---> 4166476832 bytes     ---> 3.88GB --> 3,973.12
> >>>> MB
> >>>> (Dump-Capture kernel)
> >>>> /proc/meminfo size --> MemTotal 3994184 kB  ---> 3.809GB--> 3,900.41
> >>>> MB
> >>>> (Priamry Kernel)
> >>>> 
> >>> 
> >>> Hi,
> >>> 
> >>> Look at /proc/iomem at add up the all entries of "System RAM". That
> >>> would give a good idea of total physical memory in the system.
> >>> 
> >>> I think /proc/meminfo does some filtering like removing reserved pages
> >>> while calulating total memory. So most likely it will not report 64MB
> >>> of memory reserved for dump kernel.
> >>> 
> >>> Thanks
> >>> Vivek
> >> 
> >> Thanks for your quick response.
> >> 
> >> cat /proc/iomem  | grep "System RAM"
> >> 00000000-0009fbff : System RAM    ----> 638kB
> >> 00100000-fbfeffff : System RAM    ----> 4127679kB
> >> 
> >> Total : 4127679 + 638 = 4128317kB --> 4031.56MB
> >>    4031.56MB - 64MB = 3967.56MB
> >> 
> >> /proc/vmcore size ---> 4166476832 bytes ---> 3.88GB --> 3,973.12MB
> >> (Dump-Capture kernel)
> >> 
> >> 
> >> Conclusion:-  vmcore size is approximately 6MB greater than the SYSTEM
> >> RAM size
> >> 
> >> 
> > 
> > Actually it should not be 6MB. It can be little more because of ELf
> > headers
> > and ELF notes for cpu status but 6MB seems to be too big.
> > 
> > Can you please provide following details.
> > 
> > - Full output of /proc/iomem
> [EMAIL PROTECTED] dump]# cat /proc/iomem
> 00000000-0009fbff : System RAM
> 0009fc00-0009ffff : reserved
> 000a0000-000bffff : Video RAM area
> 000c0000-000c7fff : Video ROM
> 000c8000-000cdbff : Adapter ROM
> 000ce000-000cefff : Adapter ROM
> 000cf000-000cffff : Adapter ROM
> 000f0000-000fffff : System ROM
> 00100000-fbfeffff : System RAM
>   00200000-0051e0ff : Kernel code
>   0051e100-006b927f : Kernel data
>   01000000-04ffffff : Crash kernel
> fbff0000-fbffefff : ACPI Tables
> fbfff000-fbffffff : ACPI Non-volatile Storage
> fc500000-fc7fffff : PCI Bus #01
>   fc500000-fc5fffff : PCI Bus #02
>     fc5c0000-fc5cffff : 0000:02:04.0
>     fc5d0000-fc5dffff : 0000:02:04.1
>     fc5e0000-fc5effff : 0000:02:06.0
>     fc5f0000-fc5fffff : 0000:02:06.1
>   fc780000-fc7fffff : 0000:01:01.0
>     fc780000-fc7fffff : sata_mv
> fc800000-fc9fffff : PCI Bus #03
>   fc940000-fc95ffff : 0000:03:03.0
>   fc960000-fc97ffff : 0000:03:03.0
>     fc960000-fc97ffff : e1000
>   fc980000-fc99ffff : 0000:03:03.0
>     fc980000-fc99ffff : e1000
>   fc9a0000-fc9bffff : 0000:03:04.0
>   fc9c0000-fc9dffff : 0000:03:04.0
>     fc9c0000-fc9dffff : e1000
>   fc9e0000-fc9fffff : 0000:03:04.0
>     fc9e0000-fc9fffff : e1000
> fca00000-feafffff : PCI Bus #04
>   fd000000-fdffffff : 0000:04:06.0
>   feac0000-feadffff : 0000:04:06.0
>   feafd000-feafdfff : 0000:04:00.0
>     feafd000-feafdfff : ohci_hcd
>   feafe000-feafefff : 0000:04:00.1
>     feafe000-feafefff : ohci_hcd
>   feaff000-feafffff : 0000:04:06.0
> febfe000-febfefff : IOAPIC 1
>   febfe000-febfefff : 0000:00:0a.1
> febff000-febfffff : IOAPIC 2
>   febff000-febfffff : 0000:00:0b.1
> fec00000-fec00fff : IOAPIC 0
> fee00000-fee00fff : Local APIC
> ff400000-ff5fffff : PCI Bus #01
>   ff400000-ff4fffff : PCI Bus #02
> ff7c0000-ffffffff : reserved
> [EMAIL PROTECTED] dump]# cat /proc/iomem  | grep "System RAM"
> 00000000-0009fbff : System RAM
> 00100000-fbfeffff : System RAM
> [EMAIL PROTECTED] dump]# uname -a
> 
> > - Output of readelf -a /proc/vmcore
> 
> sh-2.05b# readelf -a /proc/vmcore
> ELF Header:
>   Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
>   Class:                             ELF64
>   Data:                              2's complement, little endian
>   Version:                           1 (current)
>   OS/ABI:                            UNIX - System V
>   ABI Version:                       0
>   Type:                              CORE (Core file)
>   Machine:                           Advanced Micro Devices X86-64
>   Version:                           0x1
>   Entry point address:               0x0
>   Start of program headers:          64 (bytes into file)
>   Start of section headers:          0 (bytes into file)
>   Flags:                             0x0
>   Size of this header:               64 (bytes)
>   Size of program headers:           56 (bytes)
>   Number of program headers:         5
>   Size of section headers:           0 (bytes)
>   Number of section headers:         0
>   Section header string table index: 0
> 
> There are no sections in this file.
> 
> Program Headers:
>   Type           Offset             VirtAddr           PhysAddr
>                  FileSiz            MemSiz              Flags  Align
>   NOTE           0x0000000000000158 0x0000000000000000 0x0000000000000000
>                  0x00000000000002c8 0x00000000000002c8         0
>   LOAD           0x0000000000000420 0xffffffff80200000 0x0000000000200000
>                  0x00000000005e6000 0x00000000005e6000  RWE    0

Ok. So above header is contributing for extra size. Actually same physical
memory is mapped twice. Once in kernel text and data region and then again
in kernel linearly mapped region. 

So above mapping size is 0x56e6000 which is roughly 6MB that's why you
see vmcore size more.

So, I stand corrected. On x86_64 vmcore size will be as follows.

(RAM SIZE - reserved memory + kernel text and data size)


On i386 it will continue to be.

(RAM Size - reserved memory area)

Thanks
Vivek
_______________________________________________
fastboot mailing list
fastboot@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/fastboot

Reply via email to