0

I'm running a custom Linux distribution on my ARM-based system (it's got two A7s).

The Linux kernel version is 4.86.9.

In the process of investigating some weird graphical glitches occuring on the integrated display when running memory-intensive tasks (like tar or gzip), I executed dmesg to figure out how Linux sees system memory (which is supposed to be 620 MB out of 1 GB DDR3L, as per Yocto memory layout configuration).

The following is what dmesg showed:

Memory: 484008K/634880K available (5120K kernel code, 205K rwdata, 1476K rodata, 1024K init, 331K bss, 15704K reserved, 135168K cma-reserved, 0K highmem)
Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc : 0xd7000000 - 0xff800000   ( 648 MB)
        lowmem  : 0xb0000000 - 0xd6c00000   ( 620 MB)
        pkmap   : 0xafe00000 - 0xb0000000   (   2 MB)
        modules : 0xaf000000 - 0xafe00000   (  14 MB)
          .text : 0xb0008000 - 0xb0600000   (6112 kB)
          .init : 0xb0800000 - 0xb0900000   (1024 kB)
          .data : 0xb0900000 - 0xb0933468   ( 206 kB)
          .bss  : 0xb0935000 - 0xb0987e8c   ( 332 kB)

Something seems off:

  1. Available memory is only 484 MB/634 MB. Neither the 484 MB nor the 634 MB make sense to me.
  2. vmalloc is a whopping 648 MB.

Can you help me make sense of these values?

I point out that highmem was disabled as per Yocto configuration.

Before I disabled it, usage was still 0K (as above) but the layout displayed by dmesg is a little different:

Memory: 484720K/634880K available (5120K kernel code, 197K rwdata, 1428K rodata, 1024K init, 256K bss, 14992K reserved, 135168K cma-reserved, 0K highmem)
Virtual kernel memory layout:
        vector   : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap   : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc  : 0xe7000000 - 0xff800000   ( 392 MB)
        lowmem   : 0xc0000000 - 0xe6c00000   ( 620 MB)
        pkmap    : 0xbfe00000 - 0xc0000000   (   2 MB)
        modules  : 0xbf000000 - 0xbfe00000   (  14 MB)
           .text : 0xc0008000 - 0xc0600000   (6112 kB)
           .init : 0xc0800000 - 0xc0900000   (1024 kB)
           .data : 0xc0900000 - 0xc09314d8   ( 198 kB)
           .bss  : 0xc0933000 - 0xc09732d8   ( 257 kB)

As you can see vmalloc is 392 MB, which is only half as odd as the 648 MB!

Thanks in advance, and please pardon me if I missed something important.

1 Answer 1

0

That is just exactly what virtual memory is: mapping of the physical memory (and other things) into a completely independent memory space.

This isn't specific to your embedded device, or to Linux; that's just what virtual memory is.

That memory space can be larger or smaller than the physical memory, no problem: Nothing says every address in the virtual memory space of each process needs to map to something.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .