Re: show_mem producing invalid output

From: Tom Lendacky
Date: Mon Jul 13 2015 - 09:36:42 EST


On 07/13/2015 12:06 AM, Vishnu Pratap Singh wrote:
> Hi Tom,

Hi Vishnu,

>
> Can you please share the complete show_mem output, I wanted to know the reserved
> pages value.

sysrq: SysRq : Show Memory
Mem-Info:
active_anon:1427 inactive_anon:161 isolated_anon:0
active_file:524 inactive_file:953 isolated_file:0
unevictable:0 dirty:0 writeback:0 unstable:0
slab_reclaimable:195 slab_unreclaimable:740
mapped:517 shmem:178 pagetables:70 bounce:0
free:255076 free_pcp:71 free_cma:8156
DMA free:3993792kB min:3840kB low:4800kB high:5760kB active_anon:30656kB inactive_anon:5120kB active_file:16320kB inactive_file:27968kB unevictable:0kB isolated(anon):0kB isolato
lowmem_reserve[]: 0 764 764
Normal free:12326912kB min:11776kB low:14720kB high:17664kB active_anon:64832kB inactive_anon:5184kB active_file:17216kB inactive_file:33024kB unevictable:0kB isolated(anon):0kBo
lowmem_reserve[]: 0 0 0
DMA: 16*64kB (UE) 4*128kB (U) 3*256kB (UC) 4*512kB (UEMC) 4*1024kB (MC) 3*2048kB (UM) 4*4096kB (UEMC) 3*8192kB (UEC) 2*16384kB (EC) 7*32768kB (UEMC) 6*65536kB (UEMC) 7*131072kB B
Normal: 38*64kB (UEM) 31*128kB (UEM) 28*256kB (UM) 13*512kB (UM) 4*1024kB (UEM) 3*2048kB (EM) 3*4096kB (EM) 0*8192kB 2*16384kB (UE) 2*32768kB (UE) 2*65536kB (EM) 2*131072kB (UE)B
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=524288kB
1655 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap = 2047936kB
Total swap = 2047936kB
261888 pages RAM
0 pages HighMem/MovableOnly
18446744073709545533 pages reserved
8192 pages cma reserved

>
> Currently I see the 8192 pages as cma reserved. we get the pages reserved after
> the subtraction of (reserved-totalcma_pages).

If CMA pages are supposed to be part of the reserved space, shouldn't
the call to adjust_managed_page_count in init_cma_reserved_pageblock of
mm/page_alloc.c be for a negative amount so that the number of managed
pages is decreased (thus increasing the reserved count)?

Thanks,
Tom

>
> BR,
>
> Vishnu
>
> ------- *Original Message* -------
>
> *Sender* : Tom Lendacky<thomas.lendacky@xxxxxxx>
>
> *Date* : Jul 10, 2015 23:03 (GMT+05:30)
>
> *Title* : show_mem producing invalid output
>
> Hi Vishnu,
>
> Commit 49abd8c28046 ("lib/show_mem.c: add cma reserved information")
> causes the following output (last four lines shown):
>
> ...
> 261888 pages RAM
> 0 pages HighMem/MovableOnly
> 18446744073709545533 pages reserved
> 8192 pages cma reserved
>
> The very large "pages reserved" number is obviously invalid and is
> the result of the subtraction in the printk where "reserved" is less
> than "totalcma_pages".
>
> This is from an arm64 system.
>
> Thanks,
> Tom
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/