Memory: 880608K/983040K .... 36896K reserved ?

Michael Ellerman mpe at ellerman.id.au
Thu Jul 2 10:52:15 AEST 2020


Joakim Tjernlund <Joakim.Tjernlund at infinera.com> writes:
> I cannot figure out how the xxxK reserved item works in:
>  Memory: 880608K/983040K available (9532K kernel code, 1104K rwdata, 3348K rodata, 1088K init, 1201K bss, 36896K reserved ...

It's calculated as:

	(physpages - totalram_pages() - totalcma_pages)

The naming is a bit historical I guess.

But roughly physpages is the total number of pages of RAM we think exist
in the system.

totalram_pages() is the total number of pages that have been freed to
the buddy allocator.

totalcma_pages is pages used by CMA which is probably 0 for you.

So the amount "reserved" is the memory that hasn't been freed to the
buddy allocator by memblock.

You should be able to see it in debugfs:

# cat /sys/kernel/debug/memblock/reserved 
   0: 0x0000000000000000..0x0000000002b40e57
   1: 0x0000000002b41000..0x0000000002b413ff
   2: 0x0000000002b50000..0x0000000002baffff
   3: 0x000000000a910000..0x000000000e93ffff
   4: 0x000000000fe80000..0x000000000fe9ffff
   5: 0x000000000feac000..0x000000000ffebfff
   6: 0x000000000ffed400..0x000000000ffed7ff
   7: 0x000000000ffeda80..0x000000000ffeebff
   8: 0x000000000ffeee80..0x000000000ffeffff
   9: 0x000000000fff0280..0x000000000fff13ff
   ...

> Is there a way to tune(lower it) this memory?

Some or most of those reserved regions will be things your firmware told
you to reserve, so you need to work out what each region is. They might
be firmware things, or even holes in RAM, you need to dig deeper to find
out what is what.

cheers


More information about the Linuxppc-dev mailing list