2015-02-04 23:22:50

by Gregory Fong

[permalink] [raw]
Subject: [PATCH] ARM: print cma-reserved pages from show_mem

Add cma reserved information to the ARM-specific show_mem. It was
added to the generic implementation by commit
49abd8c28046adf77c5ce1949549aa64d7221881 "lib/show_mem.c: add cma
reserved information".

Signed-off-by: Gregory Fong <[email protected]>
---
arch/arm/mm/init.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 2495c8c..da77507 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -22,6 +22,7 @@
#include <linux/memblock.h>
#include <linux/dma-contiguous.h>
#include <linux/sizes.h>
+#include <linux/cma.h>

#include <asm/cp15.h>
#include <asm/mach-types.h>
@@ -130,6 +131,9 @@ void show_mem(unsigned int filter)
printk("%d pages of RAM\n", total);
printk("%d free pages\n", free);
printk("%d reserved pages\n", reserved);
+#ifdef CONFIG_CMA
+ printk("%lu cma reserved pages\n", totalcma_pages);
+#endif
printk("%d slab pages\n", slab);
printk("%d pages shared\n", shared);
printk("%d pages swap cached\n", cached);
--
1.9.1


2015-02-06 00:41:24

by Laura Abbott

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On 2/4/2015 3:22 PM, Gregory Fong wrote:
> Add cma reserved information to the ARM-specific show_mem. It was
> added to the generic implementation by commit
> 49abd8c28046adf77c5ce1949549aa64d7221881 "lib/show_mem.c: add cma
> reserved information".
>
> Signed-off-by: Gregory Fong <[email protected]>
> ---
> arch/arm/mm/init.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 2495c8c..da77507 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -22,6 +22,7 @@
> #include <linux/memblock.h>
> #include <linux/dma-contiguous.h>
> #include <linux/sizes.h>
> +#include <linux/cma.h>
>
> #include <asm/cp15.h>
> #include <asm/mach-types.h>
> @@ -130,6 +131,9 @@ void show_mem(unsigned int filter)
> printk("%d pages of RAM\n", total);
> printk("%d free pages\n", free);
> printk("%d reserved pages\n", reserved);
> +#ifdef CONFIG_CMA
> + printk("%lu cma reserved pages\n", totalcma_pages);
> +#endif

Nit: 'cma reserved pages' is a bit unclear. Are there some CMA
pages that aren't reserved? Dropping the reserved might be
clearer.

Thanks,
Laura

--
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2015-02-06 21:15:15

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Thu, Feb 5, 2015 at 4:41 PM, Laura Abbott <[email protected]> wrote:
> On 2/4/2015 3:22 PM, Gregory Fong wrote:
>>
>> Add cma reserved information to the ARM-specific show_mem. It was
>> added to the generic implementation by commit
>> 49abd8c28046adf77c5ce1949549aa64d7221881 "lib/show_mem.c: add cma
>> reserved information".
>>
>> Signed-off-by: Gregory Fong <[email protected]>
>> ---
>> arch/arm/mm/init.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
>> index 2495c8c..da77507 100644
>> --- a/arch/arm/mm/init.c
>> +++ b/arch/arm/mm/init.c
>> @@ -22,6 +22,7 @@
>> #include <linux/memblock.h>
>> #include <linux/dma-contiguous.h>
>> #include <linux/sizes.h>
>> +#include <linux/cma.h>
>>
>> #include <asm/cp15.h>
>> #include <asm/mach-types.h>
>> @@ -130,6 +131,9 @@ void show_mem(unsigned int filter)
>> printk("%d pages of RAM\n", total);
>> printk("%d free pages\n", free);
>> printk("%d reserved pages\n", reserved);
>> +#ifdef CONFIG_CMA
>> + printk("%lu cma reserved pages\n", totalcma_pages);
>> +#endif
>
>
> Nit: 'cma reserved pages' is a bit unclear. Are there some CMA
> pages that aren't reserved? Dropping the reserved might be
> clearer.

Sure, I was trying to replicate what's in lib/show_mem.c, but it
doesn't actually make much sense. Maybe it would be better to change
to "cma pages" here and change the wording in that lib/show_mem.c too.

I'll wait a bit for any other thoughts and send out a v2 with those changes.

Thanks,
Gregory

2015-02-06 21:41:21

by Laura Abbott

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On 2/6/2015 1:14 PM, Gregory Fong wrote:
> On Thu, Feb 5, 2015 at 4:41 PM, Laura Abbott <[email protected]> wrote:
>> On 2/4/2015 3:22 PM, Gregory Fong wrote:
>>>
>>> Add cma reserved information to the ARM-specific show_mem. It was
>>> added to the generic implementation by commit
>>> 49abd8c28046adf77c5ce1949549aa64d7221881 "lib/show_mem.c: add cma
>>> reserved information".
>>>
>>> Signed-off-by: Gregory Fong <[email protected]>
>>> ---
>>> arch/arm/mm/init.c | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
>>> index 2495c8c..da77507 100644
>>> --- a/arch/arm/mm/init.c
>>> +++ b/arch/arm/mm/init.c
>>> @@ -22,6 +22,7 @@
>>> #include <linux/memblock.h>
>>> #include <linux/dma-contiguous.h>
>>> #include <linux/sizes.h>
>>> +#include <linux/cma.h>
>>>
>>> #include <asm/cp15.h>
>>> #include <asm/mach-types.h>
>>> @@ -130,6 +131,9 @@ void show_mem(unsigned int filter)
>>> printk("%d pages of RAM\n", total);
>>> printk("%d free pages\n", free);
>>> printk("%d reserved pages\n", reserved);
>>> +#ifdef CONFIG_CMA
>>> + printk("%lu cma reserved pages\n", totalcma_pages);
>>> +#endif
>>
>>
>> Nit: 'cma reserved pages' is a bit unclear. Are there some CMA
>> pages that aren't reserved? Dropping the reserved might be
>> clearer.
>
> Sure, I was trying to replicate what's in lib/show_mem.c, but it
> doesn't actually make much sense. Maybe it would be better to change
> to "cma pages" here and change the wording in that lib/show_mem.c too.
>
> I'll wait a bit for any other thoughts and send out a v2 with those changes.
>

So it looks like the lib/show_mem.c does something different
#ifdef CONFIG_CMA
printk("%lu pages reserved\n", (reserved - totalcma_pages));
printk("%lu pages cma reserved\n", totalcma_pages);
#else
printk("%lu pages reserved\n", reserved);
#endif


No need to change the name, instead I'd say fix up arm to match what
the generic showmem is doing.

Thanks,
Laura

--
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2015-02-09 19:56:29

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Fri, Feb 6, 2015 at 1:41 PM, Laura Abbott <[email protected]> wrote:
> On 2/6/2015 1:14 PM, Gregory Fong wrote:
>>
>> On Thu, Feb 5, 2015 at 4:41 PM, Laura Abbott <[email protected]>
>> wrote:
>>>
>>> On 2/4/2015 3:22 PM, Gregory Fong wrote:
>>>>
>>>>
>>>> Add cma reserved information to the ARM-specific show_mem. It was
>>>> added to the generic implementation by commit
>>>> 49abd8c28046adf77c5ce1949549aa64d7221881 "lib/show_mem.c: add cma
>>>> reserved information".
>>>>
>>>> Signed-off-by: Gregory Fong <[email protected]>
>>>> ---
>>>> arch/arm/mm/init.c | 4 ++++
>>>> 1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
>>>> index 2495c8c..da77507 100644
>>>> --- a/arch/arm/mm/init.c
>>>> +++ b/arch/arm/mm/init.c
>>>> @@ -22,6 +22,7 @@
>>>> #include <linux/memblock.h>
>>>> #include <linux/dma-contiguous.h>
>>>> #include <linux/sizes.h>
>>>> +#include <linux/cma.h>
>>>>
>>>> #include <asm/cp15.h>
>>>> #include <asm/mach-types.h>
>>>> @@ -130,6 +131,9 @@ void show_mem(unsigned int filter)
>>>> printk("%d pages of RAM\n", total);
>>>> printk("%d free pages\n", free);
>>>> printk("%d reserved pages\n", reserved);
>>>> +#ifdef CONFIG_CMA
>>>> + printk("%lu cma reserved pages\n", totalcma_pages);
>>>> +#endif
>>>
>>>
>>>
>>> Nit: 'cma reserved pages' is a bit unclear. Are there some CMA
>>> pages that aren't reserved? Dropping the reserved might be
>>> clearer.
>>
>>
>> Sure, I was trying to replicate what's in lib/show_mem.c, but it
>> doesn't actually make much sense. Maybe it would be better to change
>> to "cma pages" here and change the wording in that lib/show_mem.c too.
>>
>> I'll wait a bit for any other thoughts and send out a v2 with those
>> changes.
>>
>
> So it looks like the lib/show_mem.c does something different
> #ifdef CONFIG_CMA
> printk("%lu pages reserved\n", (reserved - totalcma_pages));
> printk("%lu pages cma reserved\n", totalcma_pages);
> #else
> printk("%lu pages reserved\n", reserved);
> #endif
>
>
> No need to change the name, instead I'd say fix up arm to match what
> the generic showmem is doing.

The trouble is that lib/show_mem.c and ARM's show_mem use the
'reserved' variable to hold different info, which was not a problem I
was aiming to tackle here, and am not sure I understand what's going
on well enough to do so. But let's give it a shot:

In lib/show_mem.c, reserved is calculated by iterating over all online
nodes, then increasing reserved by (zone->present_pages -
zone->managed_pages). This count includes CMA pages and so when
reserved pages is printed it should be 'reserved' - totalcma_pages, as
it currently is.

In ARM's show_mem, reserved is counted by iterating over memblocks,
and within each one iterating over pfns, checking each page to see if
it's reserved, and increasing the counter accordingly. Unlike the
generic one, this results in counting reserved pages differently than
CMA pages.

Unfortunately, I don't see a good way to do the calculation different
in the generic implementation that doesn't also count CMA pages in
'reserved'---unless I'm missing something, this isn't available at the
zone info level.

If this is correct, then I think the correct set of steps is still
what I was suggesting:

1. change generic implementation to say 'cma' rather than 'cma reserved'
2. do what I did in this patch except also remove the word 'reserved'
like in (1).

Does that seem sensible?

Thanks,
Gregory

2015-02-10 11:32:46

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Mon, Feb 09, 2015 at 11:55:54AM -0800, Gregory Fong wrote:
> On Fri, Feb 6, 2015 at 1:41 PM, Laura Abbott <[email protected]> wrote:
> > So it looks like the lib/show_mem.c does something different
> > #ifdef CONFIG_CMA
> > printk("%lu pages reserved\n", (reserved - totalcma_pages));
> > printk("%lu pages cma reserved\n", totalcma_pages);
> > #else
> > printk("%lu pages reserved\n", reserved);
> > #endif
> >
> >
> > No need to change the name, instead I'd say fix up arm to match what
> > the generic showmem is doing.
>
> The trouble is that lib/show_mem.c and ARM's show_mem use the
> 'reserved' variable to hold different info, which was not a problem I
> was aiming to tackle here, and am not sure I understand what's going
> on well enough to do so. But let's give it a shot:
>
> In lib/show_mem.c, reserved is calculated by iterating over all online
> nodes, then increasing reserved by (zone->present_pages -
> zone->managed_pages). This count includes CMA pages and so when
> reserved pages is printed it should be 'reserved' - totalcma_pages, as
> it currently is.

So, some digging is needed into why the generic version is different.
You have to remember that many of the algorithms for this kind of thing
were based on the x86 implementation, so differences like this are
probably down to ARM being annoyingly overlooked or ignored when generic
changes happen.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-04-10 04:36:47

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Thu, Mar 26, 2015 at 5:30 AM, Mel Gorman <[email protected]> wrote:
> On Thu, Mar 26, 2015 at 11:46:12AM +0000, Russell King - ARM Linux wrote:
>> <SNIP>
>>
>> Looking at Mel's commit, I don't see a reason why we couldn't use that
>> solution - it gets rid of walking the page array, which has been fraught
>> in the past due to ARM having platforms which have holes in their
>> physical memory.
>>
>> We could try that solution - I don't see much downside to it. Most of
>> that information is as debug information for MM stuff anyway, and IMHO
>
> From an MM perspective, I can tell you that the information is close to
> useless for debugging anything. It's why I ditched it in that commit and
> AFAIK, no one has ever cared.
>
>> 8<===
>> From: Russell King <[email protected]>
>> Subject: [PATCH] ARM: switch to use the generic show_mem() implementation
>>
>> Switch ARM to use the generic show_mem() implementation, which displays
>> the statistics from the mm zone rather than walking the page arrays.
>>
>> Signed-off-by: Russell King <[email protected]>
>
> If this builds, boots and sysrq-m works as expected then for what it's worth
>
> Acked-by: Mel Gorman <mgorman <[email protected]>

Tried applying this change and the equivalent for 3.14. Comparing
before/after on a brcmstb platform, all of the numbers still look
right when I run sysrq-m.

Tested-by: Gregory Fong <[email protected]>

Before:

[ 12.191615] SysRq : Show Memory
[ 12.194789] Mem-info:
[ 12.197069] DMA per-cpu:
[ 12.199611] CPU 0: hi: 186, btch: 31 usd: 113
[ 12.204409] HighMem per-cpu:
[ 12.207295] CPU 0: hi: 90, btch: 15 usd: 44
[ 12.212102] active_anon:734 inactive_anon:1189 isolated_anon:0
[ 12.212102] active_file:0 inactive_file:0 isolated_file:0
[ 12.212102] unevictable:0 dirty:0 writeback:0 unstable:0
[ 12.212102] free:254104 slab_reclaimable:82 slab_unreclaimable:843
[ 12.212102] mapped:429 shmem:1815 pagetables:13 bounce:0
[ 12.212102] free_cma:4032
[ 12.243172] DMA free:754080kB min:3472kB low:4340kB high:5208kB
active_anon:180kB inactive_anon:0kB active_file:0kB inactive_file:0kB
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
shmem:0kB slab_reclaimable:328kB slab_unreclaimable:3372kB
kernel_stack:240kB pagetables:12kB unstable:0kB bounce:0kB
free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 12.283257] lowmem_reserve[]: 0 0 264 264
[ 12.287349] HighMem free:262336kB min:264kB low:572kB high:884kB
active_anon:2756kB inactive_anon:4756kB active_file:0kB
inactive_file:0kB unevictable:0kB isolated(anon):0kB
isolated(file):0kB present:270336kB managed:270336kB mlocked:0kB
dirty:0kB writeback:0kB mapped:1716kB shmem:7260kB
slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB
pagetables:40kB unstable:0kB bounce:0kB free_cma:16128kB
writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 12.328129] lowmem_reserve[]: 0 0 0 0
[ 12.331859] DMA: 6*4kB (M) 11*8kB (UEM) 7*16kB (UEM) 6*32kB (UM)
4*64kB (UM) 6*128kB (UEM) 2*256kB (M) 3*512kB (UEM) 5*1024kB (UEM)
6*2048kB (UEM) 3*4096kB (EM) 88*8192kB (MR) = 754080kB
[ 12.348817] HighMem: 2*4kB (UM) 1*8kB (M) 1*16kB (M) 1*32kB (M)
0*64kB 1*128kB (U) 2*256kB (UC) 3*512kB (UMC) 2*1024kB (UC) 2*2048kB
(UC) 2*4096kB (UC) 30*8192kB (MRC) = 262336kB
[ 12.365058] 1815 total pagecache pages
[ 12.368816] 0 pages in swap cache
[ 12.372136] Swap cache stats: add 0, delete 0, find 0/0
[ 12.377366] Free swap = 0kB
[ 12.380251] Total swap = 0kB
[ 12.392342] 262144 pages of RAM
[ 12.395494] 254306 free pages
[ 12.398464] 4747 reserved pages
[ 12.401609] 834 slab pages
[ 12.404319] 1069 pages shared
[ 12.407290] 0 pages swap cache

After:

[ 3.743999] SysRq : Show Memory
[ 3.747171] Mem-Info:
[ 3.749451] DMA per-cpu:
[ 3.751991] CPU 0: hi: 186, btch: 31 usd: 102
[ 3.756790] HighMem per-cpu:
[ 3.759678] CPU 0: hi: 90, btch: 15 usd: 27
[ 3.764486] active_anon:724 inactive_anon:1189 isolated_anon:0
[ 3.764486] active_file:0 inactive_file:0 isolated_file:0
[ 3.764486] unevictable:0 dirty:0 writeback:0 unstable:0
[ 3.764486] free:254134 slab_reclaimable:81 slab_unreclaimable:842
[ 3.764486] mapped:429 shmem:1815 pagetables:13 bounce:0
[ 3.764486] free_cma:4032
[ 3.795556] DMA free:754080kB min:3472kB low:4340kB high:5208kB
active_anon:208kB inactive_anon:0kB active_file:0kB inactive_file:0kB
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
shmem:0kB slab_reclaimable:324kB slab_unreclaimable:3368kB
kernel_stack:240kB pagetables:36kB unstable:0kB bounce:0kB
free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 3.835641] lowmem_reserve[]: 0 0 264 264
[ 3.839734] HighMem free:262456kB min:264kB low:572kB high:884kB
active_anon:2688kB inactive_anon:4756kB active_file:0kB
inactive_file:0kB unevictable:0kB isolated(anon):0kB
isolated(file):0kB present:270336kB managed:270336kB mlocked:0kB
dirty:0kB writeback:0kB mapped:1716kB shmem:7260kB
slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB
pagetables:16kB unstable:0kB bounce:0kB free_cma:16128kB
writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 3.880512] lowmem_reserve[]: 0 0 0 0
[ 3.884244] DMA: 6*4kB (M) 11*8kB (UEM) 7*16kB (UEM) 6*32kB (UM)
4*64kB (UM) 6*128kB (UEM) 2*256kB (M) 3*512kB (UEM) 5*1024kB (UEM)
6*2048kB (UEM) 3*4096kB (EM) 88*8192kB (MR) = 754080kB
[ 3.901199] HighMem: 0*4kB 1*8kB (M) 1*16kB (M) 1*32kB (M) 2*64kB
(UM) 1*128kB (U) 2*256kB (UC) 3*512kB (UMC) 2*1024kB (UC) 2*2048kB
(UC) 2*4096kB (UC) 30*8192kB (MRC) = 262456kB
[ 3.917441] 1815 total pagecache pages
[ 3.921198] 0 pages in swap cache
[ 3.924518] Swap cache stats: add 0, delete 0, find 0/0
[ 3.929748] Free swap = 0kB
[ 3.932632] Total swap = 0kB
[ 3.935516] 262144 pages RAM
[ 3.938401] 67584 pages HighMem/MovableOnly
[ 3.942588] 651 pages reserved
[ 3.945646] 4096 pages cma reserved

2015-04-10 05:18:13

by Wang, Yalin

[permalink] [raw]
Subject: RE: [PATCH] ARM: print cma-reserved pages from show_mem

> -----Original Message-----
> From: Gregory Fong [mailto:[email protected]]
> Sent: Friday, April 10, 2015 12:36 PM
> To: Mel Gorman
> Cc: Russell King - ARM Linux; Laura Abbott; Florian Fainelli; Kees Cook;
> Nicolas Pitre; Catalin Marinas; open list; Wang, Yalin; linux-arm-
> [email protected]; [email protected]; Marek Szyprowski;
> Johannes Weiner
> Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem
>
> On Thu, Mar 26, 2015 at 5:30 AM, Mel Gorman <[email protected]> wrote:
> > On Thu, Mar 26, 2015 at 11:46:12AM +0000, Russell King - ARM Linux wrote:
> >> <SNIP>
> >>
> >> Looking at Mel's commit, I don't see a reason why we couldn't use that
> >> solution - it gets rid of walking the page array, which has been fraught
> >> in the past due to ARM having platforms which have holes in their
> >> physical memory.
> >>
> >> We could try that solution - I don't see much downside to it. Most of
> >> that information is as debug information for MM stuff anyway, and IMHO
> >
> > From an MM perspective, I can tell you that the information is close to
> > useless for debugging anything. It's why I ditched it in that commit and
> > AFAIK, no one has ever cared.
> >
> >> 8<===
> >> From: Russell King <[email protected]>
> >> Subject: [PATCH] ARM: switch to use the generic show_mem()
> implementation
> >>
> >> Switch ARM to use the generic show_mem() implementation, which displays
> >> the statistics from the mm zone rather than walking the page arrays.
> >>
> >> Signed-off-by: Russell King <[email protected]>
> >
> > If this builds, boots and sysrq-m works as expected then for what it's
> worth
> >
> > Acked-by: Mel Gorman <mgorman <[email protected]>
>
> Tried applying this change and the equivalent for 3.14. Comparing
> before/after on a brcmstb platform, all of the numbers still look
> right when I run sysrq-m.
>
> Tested-by: Gregory Fong <[email protected]>
>
> Before:
>
> [ 12.191615] SysRq : Show Memory
> [ 12.194789] Mem-info:
> [ 12.197069] DMA per-cpu:
> [ 12.199611] CPU 0: hi: 186, btch: 31 usd: 113
> [ 12.204409] HighMem per-cpu:
> [ 12.207295] CPU 0: hi: 90, btch: 15 usd: 44
> [ 12.212102] active_anon:734 inactive_anon:1189 isolated_anon:0
> [ 12.212102] active_file:0 inactive_file:0 isolated_file:0
> [ 12.212102] unevictable:0 dirty:0 writeback:0 unstable:0
> [ 12.212102] free:254104 slab_reclaimable:82 slab_unreclaimable:843
> [ 12.212102] mapped:429 shmem:1815 pagetables:13 bounce:0
> [ 12.212102] free_cma:4032
> [ 12.243172] DMA free:754080kB min:3472kB low:4340kB high:5208kB
> active_anon:180kB inactive_anon:0kB active_file:0kB inactive_file:0kB
> unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
> managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
> shmem:0kB slab_reclaimable:328kB slab_unreclaimable:3372kB
> kernel_stack:240kB pagetables:12kB unstable:0kB bounce:0kB
> free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
> [ 12.283257] lowmem_reserve[]: 0 0 264 264
> [ 12.287349] HighMem free:262336kB min:264kB low:572kB high:884kB
> active_anon:2756kB inactive_anon:4756kB active_file:0kB
> inactive_file:0kB unevictable:0kB isolated(anon):0kB
> isolated(file):0kB present:270336kB managed:270336kB mlocked:0kB
> dirty:0kB writeback:0kB mapped:1716kB shmem:7260kB
> slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB
> pagetables:40kB unstable:0kB bounce:0kB free_cma:16128kB
> writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
> [ 12.328129] lowmem_reserve[]: 0 0 0 0
> [ 12.331859] DMA: 6*4kB (M) 11*8kB (UEM) 7*16kB (UEM) 6*32kB (UM)
> 4*64kB (UM) 6*128kB (UEM) 2*256kB (M) 3*512kB (UEM) 5*1024kB (UEM)
> 6*2048kB (UEM) 3*4096kB (EM) 88*8192kB (MR) = 754080kB
> [ 12.348817] HighMem: 2*4kB (UM) 1*8kB (M) 1*16kB (M) 1*32kB (M)
> 0*64kB 1*128kB (U) 2*256kB (UC) 3*512kB (UMC) 2*1024kB (UC) 2*2048kB
> (UC) 2*4096kB (UC) 30*8192kB (MRC) = 262336kB
> [ 12.365058] 1815 total pagecache pages
> [ 12.368816] 0 pages in swap cache
> [ 12.372136] Swap cache stats: add 0, delete 0, find 0/0
> [ 12.377366] Free swap = 0kB
> [ 12.380251] Total swap = 0kB
> [ 12.392342] 262144 pages of RAM
> [ 12.395494] 254306 free pages
> [ 12.398464] 4747 reserved pages
> [ 12.401609] 834 slab pages
> [ 12.404319] 1069 pages shared
> [ 12.407290] 0 pages swap cache
>
> After:
>
> [ 3.743999] SysRq : Show Memory
> [ 3.747171] Mem-Info:
> [ 3.749451] DMA per-cpu:
> [ 3.751991] CPU 0: hi: 186, btch: 31 usd: 102
> [ 3.756790] HighMem per-cpu:
> [ 3.759678] CPU 0: hi: 90, btch: 15 usd: 27
> [ 3.764486] active_anon:724 inactive_anon:1189 isolated_anon:0
> [ 3.764486] active_file:0 inactive_file:0 isolated_file:0
> [ 3.764486] unevictable:0 dirty:0 writeback:0 unstable:0
> [ 3.764486] free:254134 slab_reclaimable:81 slab_unreclaimable:842
> [ 3.764486] mapped:429 shmem:1815 pagetables:13 bounce:0
> [ 3.764486] free_cma:4032
> [ 3.795556] DMA free:754080kB min:3472kB low:4340kB high:5208kB
> active_anon:208kB inactive_anon:0kB active_file:0kB inactive_file:0kB
> unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
> managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
> shmem:0kB slab_reclaimable:324kB slab_unreclaimable:3368kB
> kernel_stack:240kB pagetables:36kB unstable:0kB bounce:0kB
> free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
> [ 3.835641] lowmem_reserve[]: 0 0 264 264
> [ 3.839734] HighMem free:262456kB min:264kB low:572kB high:884kB
> active_anon:2688kB inactive_anon:4756kB active_file:0kB
> inactive_file:0kB unevictable:0kB isolated(anon):0kB
> isolated(file):0kB present:270336kB managed:270336kB mlocked:0kB
> dirty:0kB writeback:0kB mapped:1716kB shmem:7260kB
> slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB
> pagetables:16kB unstable:0kB bounce:0kB free_cma:16128kB
> writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
> [ 3.880512] lowmem_reserve[]: 0 0 0 0
> [ 3.884244] DMA: 6*4kB (M) 11*8kB (UEM) 7*16kB (UEM) 6*32kB (UM)
> 4*64kB (UM) 6*128kB (UEM) 2*256kB (M) 3*512kB (UEM) 5*1024kB (UEM)
> 6*2048kB (UEM) 3*4096kB (EM) 88*8192kB (MR) = 754080kB
> [ 3.901199] HighMem: 0*4kB 1*8kB (M) 1*16kB (M) 1*32kB (M) 2*64kB
> (UM) 1*128kB (U) 2*256kB (UC) 3*512kB (UMC) 2*1024kB (UC) 2*2048kB
> (UC) 2*4096kB (UC) 30*8192kB (MRC) = 262456kB
> [ 3.917441] 1815 total pagecache pages
> [ 3.921198] 0 pages in swap cache
> [ 3.924518] Swap cache stats: add 0, delete 0, find 0/0
> [ 3.929748] Free swap = 0kB
> [ 3.932632] Total swap = 0kB
> [ 3.935516] 262144 pages RAM
> [ 3.938401] 67584 pages HighMem/MovableOnly
> [ 3.942588] 651 pages reserved
> [ 3.945646] 4096 pages cma reserved
Could we also add "834 slab pages" item into generic show_mem( )
Function? It is useful, and is it equal to slab_reclaimable + slab_unreclaimable ?
If yes, I think we can add it just like what ARM does.

Thanks




????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2015-04-10 11:24:55

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Fri, Apr 10, 2015 at 01:18:04PM +0800, Wang, Yalin wrote:
> > [ 12.212102] active_anon:734 inactive_anon:1189 isolated_anon:0
> > [ 12.212102] active_file:0 inactive_file:0 isolated_file:0
> > [ 12.212102] unevictable:0 dirty:0 writeback:0 unstable:0
> > [ 12.212102] free:254104 slab_reclaimable:82 slab_unreclaimable:843

Here, we have 82 pages reclaimable, which is 328kB, and 843 unreclaimable
which is 3372kB, which is a total of 925 pages.

> > [ 12.212102] mapped:429 shmem:1815 pagetables:13 bounce:0
> > [ 12.212102] free_cma:4032
> > [ 12.243172] DMA free:754080kB min:3472kB low:4340kB high:5208kB
> > active_anon:180kB inactive_anon:0kB active_file:0kB inactive_file:0kB
> > unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
> > managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
> > shmem:0kB slab_reclaimable:328kB slab_unreclaimable:3372kB

Which agrees here.

> > [ 12.401609] 834 slab pages

but not here... this is an interesting difference, because in the ARM
version of show_mem(), we count the actual number of pages where
PageSlab() returns true. Can slab pages also be reserved pages or
swap cache pages? I thought they were exclusive of those. So, the
question comes... why the difference in accounting, and which one is
correct.

Maybe there's a bug in the accounting somewhere...

So I think we're not ready for this patch to be merged yet.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-04-13 01:09:19

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Fri, Apr 10, 2015 at 12:24:31PM +0100, Russell King - ARM Linux wrote:
> On Fri, Apr 10, 2015 at 01:18:04PM +0800, Wang, Yalin wrote:
> > > [ 12.212102] active_anon:734 inactive_anon:1189 isolated_anon:0
> > > [ 12.212102] active_file:0 inactive_file:0 isolated_file:0
> > > [ 12.212102] unevictable:0 dirty:0 writeback:0 unstable:0
> > > [ 12.212102] free:254104 slab_reclaimable:82 slab_unreclaimable:843
>
> Here, we have 82 pages reclaimable, which is 328kB, and 843 unreclaimable
> which is 3372kB, which is a total of 925 pages.
>
> > > [ 12.212102] mapped:429 shmem:1815 pagetables:13 bounce:0
> > > [ 12.212102] free_cma:4032
> > > [ 12.243172] DMA free:754080kB min:3472kB low:4340kB high:5208kB
> > > active_anon:180kB inactive_anon:0kB active_file:0kB inactive_file:0kB
> > > unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
> > > managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
> > > shmem:0kB slab_reclaimable:328kB slab_unreclaimable:3372kB
>
> Which agrees here.
>
> > > [ 12.401609] 834 slab pages
>
> but not here... this is an interesting difference, because in the ARM
> version of show_mem(), we count the actual number of pages where
> PageSlab() returns true. Can slab pages also be reserved pages or
> swap cache pages? I thought they were exclusive of those. So, the
> question comes... why the difference in accounting, and which one is
> correct.
>
> Maybe there's a bug in the accounting somewhere...

Yes, the ARM show_mem wasn't updated after the various allocators
(SLUB, SLAB, SLOB) were updated to use compound pages. Fixing it, you
get

[ 7.081826] sysrq: SysRq : Show Memory
[ 7.085610] Mem-info:
[ 7.087890] DMA per-cpu:
[ 7.090431] CPU 0: hi: 186, btch: 31 usd: 98
[ 7.095230] HighMem per-cpu:
[ 7.098116] CPU 0: hi: 90, btch: 15 usd: 29
[ 7.102923] active_anon:724 inactive_anon:1189 isolated_anon:0
[ 7.102923] active_file:0 inactive_file:0 isolated_file:0
[ 7.102923] unevictable:0 dirty:0 writeback:0 unstable:0
[ 7.102923] free:253980 slab_reclaimable:83 slab_unreclaimable:846
[ 7.102923] mapped:429 shmem:1815 pagetables:15 bounce:0
[ 7.102923] free_cma:4032
[ 7.133995] DMA free:753344kB min:3472kB low:4340kB high:5208kB active_anon:292kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB managed:759188kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:332kB slab_unreclaimable:3384kB kernel_stack:256kB pagetables:36kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 7.174080] lowmem_reserve[]: 0 0 264 264
[ 7.178175] HighMem free:262576kB min:264kB low:572kB high:884kB active_anon:2604kB inactive_anon:4756kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:270336kB managed:270336kB mlocked:0kB dirty:0kB writeback:0kB mapped:1716kB shmem:7260kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:24kB unstable:0kB bounce:0kB free_cma:16128kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 7.218955] lowmem_reserve[]: 0 0 0 0
[ 7.222687] DMA: 8*4kB (UEM) 8*8kB (UM) 4*16kB (UEM) 5*32kB (UM) 2*64kB (M) 4*128kB (UEM) 3*256kB (M) 2*512kB (EM) 5*1024kB (UEM) 6*2048kB (UEM) 3*4096kB (EM) 88*8192kB (MR) = 753344kB
[ 7.239477] HighMem: 0*4kB 0*8kB 1*16kB (M) 1*32kB (M) 2*64kB (UM) 2*128kB (UM) 2*256kB (UC) 3*512kB (UMC) 2*1024kB (UC) 2*2048kB (UC) 2*4096kB (UC) 30*8192kB (MRC) = 262576kB
[ 7.255455] 1815 total pagecache pages
[ 7.259211] 0 pages in swap cache
[ 7.262533] Swap cache stats: add 0, delete 0, find 0/0
[ 7.267764] Free swap = 0kB
[ 7.270647] Total swap = 0kB
[ 7.282890] 262144 pages of RAM
[ 7.286041] 254274 free pages
[ 7.289013] 4763 reserved pages
[ 7.292157] 929 slab pages
[ 7.294868] 1063 pages shared
[ 7.297839] 0 pages swap cached

And now we see 83 slab_reclaimable + 846 slab_unreclaimable adds up
correctly to the total of 929.

The patch below will end up with the correct count.

8<===
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 1609b02..8d606bb 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -117,7 +117,7 @@ void show_mem(unsigned int filter)
else if (PageSwapCache(page))
cached++;
else if (PageSlab(page))
- slab++;
+ slab += 1 << compound_order(page);
else if (!page_count(page))
free++;
else

--
Gregory V. Fong >< GPG key: 0BAE9648

2015-04-13 01:21:21

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Sun, Apr 12, 2015 at 06:09:13PM -0700, Gregory Fong wrote:
> On Fri, Apr 10, 2015 at 12:24:31PM +0100, Russell King - ARM Linux wrote:
> > On Fri, Apr 10, 2015 at 01:18:04PM +0800, Wang, Yalin wrote:
> > > > [ 12.212102] active_anon:734 inactive_anon:1189 isolated_anon:0
> > > > [ 12.212102] active_file:0 inactive_file:0 isolated_file:0
> > > > [ 12.212102] unevictable:0 dirty:0 writeback:0 unstable:0
> > > > [ 12.212102] free:254104 slab_reclaimable:82 slab_unreclaimable:843
> >
> > Here, we have 82 pages reclaimable, which is 328kB, and 843 unreclaimable
> > which is 3372kB, which is a total of 925 pages.
> >
> > > > [ 12.212102] mapped:429 shmem:1815 pagetables:13 bounce:0
> > > > [ 12.212102] free_cma:4032
> > > > [ 12.243172] DMA free:754080kB min:3472kB low:4340kB high:5208kB
> > > > active_anon:180kB inactive_anon:0kB active_file:0kB inactive_file:0kB
> > > > unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB
> > > > managed:759252kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB
> > > > shmem:0kB slab_reclaimable:328kB slab_unreclaimable:3372kB
> >
> > Which agrees here.
> >
> > > > [ 12.401609] 834 slab pages
> >
> > but not here... this is an interesting difference, because in the ARM
> > version of show_mem(), we count the actual number of pages where
> > PageSlab() returns true. Can slab pages also be reserved pages or
> > swap cache pages? I thought they were exclusive of those. So, the
> > question comes... why the difference in accounting, and which one is
> > correct.
> >
> > Maybe there's a bug in the accounting somewhere...
>
> Yes, the ARM show_mem wasn't updated after the various allocators
> (SLUB, SLAB, SLOB) were updated to use compound pages. Fixing it, you
> get
>
> [ 7.081826] sysrq: SysRq : Show Memory
> [ 7.085610] Mem-info:
> [ 7.087890] DMA per-cpu:
> [ 7.090431] CPU 0: hi: 186, btch: 31 usd: 98
> [ 7.095230] HighMem per-cpu:
> [ 7.098116] CPU 0: hi: 90, btch: 15 usd: 29
> [ 7.102923] active_anon:724 inactive_anon:1189 isolated_anon:0
> [ 7.102923] active_file:0 inactive_file:0 isolated_file:0
> [ 7.102923] unevictable:0 dirty:0 writeback:0 unstable:0
> [ 7.102923] free:253980 slab_reclaimable:83 slab_unreclaimable:846
> [ 7.102923] mapped:429 shmem:1815 pagetables:15 bounce:0
> [ 7.102923] free_cma:4032
> [ 7.133995] DMA free:753344kB min:3472kB low:4340kB high:5208kB active_anon:292kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:778240kB managed:759188kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:332kB slab_unreclaimable:3384kB kernel_stack:256kB pagetables:36kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
> [ 7.174080] lowmem_reserve[]: 0 0 264 264
> [ 7.178175] HighMem free:262576kB min:264kB low:572kB high:884kB active_anon:2604kB inactive_anon:4756kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:270336kB managed:270336kB mlocked:0kB dirty:0kB writeback:0kB mapped:1716kB shmem:7260kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:24kB unstable:0kB bounce:0kB free_cma:16128kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
> [ 7.218955] lowmem_reserve[]: 0 0 0 0
> [ 7.222687] DMA: 8*4kB (UEM) 8*8kB (UM) 4*16kB (UEM) 5*32kB (UM) 2*64kB (M) 4*128kB (UEM) 3*256kB (M) 2*512kB (EM) 5*1024kB (UEM) 6*2048kB (UEM) 3*4096kB (EM) 88*8192kB (MR) = 753344kB
> [ 7.239477] HighMem: 0*4kB 0*8kB 1*16kB (M) 1*32kB (M) 2*64kB (UM) 2*128kB (UM) 2*256kB (UC) 3*512kB (UMC) 2*1024kB (UC) 2*2048kB (UC) 2*4096kB (UC) 30*8192kB (MRC) = 262576kB
> [ 7.255455] 1815 total pagecache pages
> [ 7.259211] 0 pages in swap cache
> [ 7.262533] Swap cache stats: add 0, delete 0, find 0/0
> [ 7.267764] Free swap = 0kB
> [ 7.270647] Total swap = 0kB
> [ 7.282890] 262144 pages of RAM
> [ 7.286041] 254274 free pages
> [ 7.289013] 4763 reserved pages
> [ 7.292157] 929 slab pages
> [ 7.294868] 1063 pages shared
> [ 7.297839] 0 pages swap cached
>
> And now we see 83 slab_reclaimable + 846 slab_unreclaimable adds up
> correctly to the total of 929.
>
> The patch below will end up with the correct count.
>

Sorry, messed up the patch formatting. Here it is fixed:

8<===
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 1609b02..8d606bb 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -117,7 +117,7 @@ void show_mem(unsigned int filter)
else if (PageSwapCache(page))
cached++;
else if (PageSlab(page))
- slab++;
+ slab += 1 << compound_order(page);
else if (!page_count(page))
free++;
else

--
Gregory V. Fong >< GPG key: 782EF5EE

2015-04-13 09:57:15

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Sun, Apr 12, 2015 at 06:21:15PM -0700, Gregory Fong wrote:
> On Sun, Apr 12, 2015 at 06:09:13PM -0700, Gregory Fong wrote:
> > And now we see 83 slab_reclaimable + 846 slab_unreclaimable adds up
> > correctly to the total of 929.
> >
> > The patch below will end up with the correct count.
> >
>
> Sorry, messed up the patch formatting. Here it is fixed:

So now the question is: do we fix this, or do we use the generic version?
Given that the total number of slab pages can be easily deduced from the
generic statistics, do we need to modify the generic version to print an
additional line with this? It seems wasteful to do so, and just adds
more noise to the kernel's debug output.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-04-13 10:04:34

by Mel Gorman

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Mon, Apr 13, 2015 at 10:56:45AM +0100, Russell King - ARM Linux wrote:
> On Sun, Apr 12, 2015 at 06:21:15PM -0700, Gregory Fong wrote:
> > On Sun, Apr 12, 2015 at 06:09:13PM -0700, Gregory Fong wrote:
> > > And now we see 83 slab_reclaimable + 846 slab_unreclaimable adds up
> > > correctly to the total of 929.
> > >
> > > The patch below will end up with the correct count.
> > >
> >
> > Sorry, messed up the patch formatting. Here it is fixed:
>
> So now the question is: do we fix this, or do we use the generic version?
> Given that the total number of slab pages can be easily deduced from the
> generic statistics, do we need to modify the generic version to print an
> additional line with this?

Whatever ARM decides, I do not think the generic version needs to do
a PFN walk to recaluate the SLAB statistics. The slab_reclaimable and
slab_unreclaimable stats based on the vmstat counters is sufficient.

--
Mel Gorman
SUSE Labs

2015-04-13 10:05:55

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Mon, Apr 13, 2015 at 11:04:26AM +0100, Mel Gorman wrote:
> On Mon, Apr 13, 2015 at 10:56:45AM +0100, Russell King - ARM Linux wrote:
> > On Sun, Apr 12, 2015 at 06:21:15PM -0700, Gregory Fong wrote:
> > > On Sun, Apr 12, 2015 at 06:09:13PM -0700, Gregory Fong wrote:
> > > > And now we see 83 slab_reclaimable + 846 slab_unreclaimable adds up
> > > > correctly to the total of 929.
> > > >
> > > > The patch below will end up with the correct count.
> > > >
> > >
> > > Sorry, messed up the patch formatting. Here it is fixed:
> >
> > So now the question is: do we fix this, or do we use the generic version?
> > Given that the total number of slab pages can be easily deduced from the
> > generic statistics, do we need to modify the generic version to print an
> > additional line with this?
>
> Whatever ARM decides, I do not think the generic version needs to do
> a PFN walk to recaluate the SLAB statistics. The slab_reclaimable and
> slab_unreclaimable stats based on the vmstat counters is sufficient.

Yes, I agree. My feeling is we just switch to the generic version and be
done with it.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-04-13 12:29:50

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH] ARM: print cma-reserved pages from show_mem

On Mon, Apr 13, 2015 at 3:05 AM, Russell King - ARM Linux
<[email protected]> wrote:
> On Mon, Apr 13, 2015 at 11:04:26AM +0100, Mel Gorman wrote:
>> On Mon, Apr 13, 2015 at 10:56:45AM +0100, Russell King - ARM Linux wrote:
>> > On Sun, Apr 12, 2015 at 06:21:15PM -0700, Gregory Fong wrote:
>> > > On Sun, Apr 12, 2015 at 06:09:13PM -0700, Gregory Fong wrote:
>> > > > And now we see 83 slab_reclaimable + 846 slab_unreclaimable adds up
>> > > > correctly to the total of 929.
>> > > >
>> > > > The patch below will end up with the correct count.
>> > > >
>> > >
>> > > Sorry, messed up the patch formatting. Here it is fixed:
>> >
>> > So now the question is: do we fix this, or do we use the generic version?
>> > Given that the total number of slab pages can be easily deduced from the
>> > generic statistics, do we need to modify the generic version to print an
>> > additional line with this?
>>
>> Whatever ARM decides, I do not think the generic version needs to do
>> a PFN walk to recaluate the SLAB statistics. The slab_reclaimable and
>> slab_unreclaimable stats based on the vmstat counters is sufficient.
>
> Yes, I agree. My feeling is we just switch to the generic version and be
> done with it.

Agreed. This is really what I was hoping for in the first place, but
didn't know before submitting the initial patch whether there was some
arcane reason for the arm-specific show_mem.

If someone like Yalin really wants the total slab pages, they can just
add slab_unreclaimable and slab_reclaimable (btw, Yalin, all emails
I've sent to you are bouncing, maybe you'll see this since it's going
to the list).

Thanks,
Gregory