All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] mm: direct mapping count in /proc/meminfo is error
@ 2015-11-20  8:17 ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-11-20  8:17 UTC (permalink / raw)
  To: Andrew Morton, Tang Chen, zhong jiang, Minchan Kim, Mel Gorman
  Cc: Linux MM, LKML

I find the direct mapping count in /proc/meminfo is error. 
The value should be equal to the size of init_memory_mapping which
showed in boot log. 

I add some print to show direct_pages_count[] immediately after
init_memory_mapping(). The reason is that we double counting.

Here is the log(kernel v4.4):
...
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]  // called from "init_memory_mapping(0, ISA_END_ADDRESS);"
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] BRK [0x01ebf000, 0x01ebffff] PGTABLE
[    0.000000] BRK [0x01ec0000, 0x01ec0fff] PGTABLE
[    0.000000] BRK [0x01ec1000, 0x01ec1fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0xc3fe00000-0xc3fffffff]  // called from "memory_map_top_down(ISA_END_ADDRESS, end);"
[    0.000000]  [mem 0xc3fe00000-0xc3fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) one time
[    0.000000] init_memory_mapping: [mem 0xc20000000-0xc3fdfffff]
[    0.000000]  [mem 0xc20000000-0xc3fdfffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) two time
[    0.000000] init_memory_mapping: [mem 0x00100000-0xbf78ffff]
[    0.000000]  [mem 0x00100000-0x001fffff] page 4k
[    0.000000]  [mem 0x00200000-0x3fffffff] page 2M
[    0.000000]  [mem 0x40000000-0x7fffffff] page 1G
[    0.000000]  [mem 0x80000000-0xbf5fffff] page 2M
[    0.000000]  [mem 0xbf600000-0xbf78ffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x100000000-0xc1fffffff]
[    0.000000]  [mem 0x100000000-0xc1fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) three time
...
[    0.000000] DirectMap4k:        3648 kB
[    0.000000] DirectMap2M:     2084864 kB
[    0.000000] DirectMap1G:    50331648 kB

euler-linux:~ # cat /proc/meminfo | grep DirectMap
DirectMap4k:       91712 kB
DirectMap2M:     4093952 kB
DirectMap1G:    48234496 kB


total DirectMap is 48234496 + 4093952 + 91712 = 52420160kb
		    50331648 + 2084864 + 3648 = 52420160kb
total init_memory_mapping is 50323008kb

52420160kb - 50323008kb = 2097152kb = 2G

However I haven't find a better way to fix it, any ideas?

Thanks,
Xishi Qiu



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [RFC] mm: direct mapping count in /proc/meminfo is error
@ 2015-11-20  8:17 ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-11-20  8:17 UTC (permalink / raw)
  To: Andrew Morton, Tang Chen, zhong jiang, Minchan Kim, Mel Gorman
  Cc: Linux MM, LKML

I find the direct mapping count in /proc/meminfo is error. 
The value should be equal to the size of init_memory_mapping which
showed in boot log. 

I add some print to show direct_pages_count[] immediately after
init_memory_mapping(). The reason is that we double counting.

Here is the log(kernel v4.4):
...
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]  // called from "init_memory_mapping(0, ISA_END_ADDRESS);"
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] BRK [0x01ebf000, 0x01ebffff] PGTABLE
[    0.000000] BRK [0x01ec0000, 0x01ec0fff] PGTABLE
[    0.000000] BRK [0x01ec1000, 0x01ec1fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0xc3fe00000-0xc3fffffff]  // called from "memory_map_top_down(ISA_END_ADDRESS, end);"
[    0.000000]  [mem 0xc3fe00000-0xc3fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) one time
[    0.000000] init_memory_mapping: [mem 0xc20000000-0xc3fdfffff]
[    0.000000]  [mem 0xc20000000-0xc3fdfffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) two time
[    0.000000] init_memory_mapping: [mem 0x00100000-0xbf78ffff]
[    0.000000]  [mem 0x00100000-0x001fffff] page 4k
[    0.000000]  [mem 0x00200000-0x3fffffff] page 2M
[    0.000000]  [mem 0x40000000-0x7fffffff] page 1G
[    0.000000]  [mem 0x80000000-0xbf5fffff] page 2M
[    0.000000]  [mem 0xbf600000-0xbf78ffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x100000000-0xc1fffffff]
[    0.000000]  [mem 0x100000000-0xc1fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) three time
...
[    0.000000] DirectMap4k:        3648 kB
[    0.000000] DirectMap2M:     2084864 kB
[    0.000000] DirectMap1G:    50331648 kB

euler-linux:~ # cat /proc/meminfo | grep DirectMap
DirectMap4k:       91712 kB
DirectMap2M:     4093952 kB
DirectMap1G:    48234496 kB


total DirectMap is 48234496 + 4093952 + 91712 = 52420160kb
		    50331648 + 2084864 + 3648 = 52420160kb
total init_memory_mapping is 50323008kb

52420160kb - 50323008kb = 2097152kb = 2G

However I haven't find a better way to fix it, any ideas?

Thanks,
Xishi Qiu


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] mm: direct mapping count in /proc/meminfo is error
  2015-11-20  8:17 ` Xishi Qiu
@ 2015-11-20  8:43   ` Tang Chen
  -1 siblings, 0 replies; 6+ messages in thread
From: Tang Chen @ 2015-11-20  8:43 UTC (permalink / raw)
  To: Xishi Qiu, Andrew Morton, zhong jiang, Minchan Kim, Mel Gorman
  Cc: Linux MM, LKML

Hi Shi,

Would you please share where did you add the printk debug info ?

Thanks. :)

On 11/20/2015 04:17 PM, Xishi Qiu wrote:
> I find the direct mapping count in /proc/meminfo is error.
> The value should be equal to the size of init_memory_mapping which
> showed in boot log.
>
> I add some print to show direct_pages_count[] immediately after
> init_memory_mapping(). The reason is that we double counting.
>
> Here is the log(kernel v4.4):
> ...
> [    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]  // called from "init_memory_mapping(0, ISA_END_ADDRESS);"
> [    0.000000]  [mem 0x00000000-0x000fffff] page 4k
> [    0.000000] BRK [0x01ebf000, 0x01ebffff] PGTABLE
> [    0.000000] BRK [0x01ec0000, 0x01ec0fff] PGTABLE
> [    0.000000] BRK [0x01ec1000, 0x01ec1fff] PGTABLE
> [    0.000000] init_memory_mapping: [mem 0xc3fe00000-0xc3fffffff]  // called from "memory_map_top_down(ISA_END_ADDRESS, end);"
> [    0.000000]  [mem 0xc3fe00000-0xc3fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) one time
> [    0.000000] init_memory_mapping: [mem 0xc20000000-0xc3fdfffff]
> [    0.000000]  [mem 0xc20000000-0xc3fdfffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) two time
> [    0.000000] init_memory_mapping: [mem 0x00100000-0xbf78ffff]
> [    0.000000]  [mem 0x00100000-0x001fffff] page 4k
> [    0.000000]  [mem 0x00200000-0x3fffffff] page 2M
> [    0.000000]  [mem 0x40000000-0x7fffffff] page 1G
> [    0.000000]  [mem 0x80000000-0xbf5fffff] page 2M
> [    0.000000]  [mem 0xbf600000-0xbf78ffff] page 4k
> [    0.000000] init_memory_mapping: [mem 0x100000000-0xc1fffffff]
> [    0.000000]  [mem 0x100000000-0xc1fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) three time
> ...
> [    0.000000] DirectMap4k:        3648 kB
> [    0.000000] DirectMap2M:     2084864 kB
> [    0.000000] DirectMap1G:    50331648 kB
>
> euler-linux:~ # cat /proc/meminfo | grep DirectMap
> DirectMap4k:       91712 kB
> DirectMap2M:     4093952 kB
> DirectMap1G:    48234496 kB
>
>
> total DirectMap is 48234496 + 4093952 + 91712 = 52420160kb
> 		    50331648 + 2084864 + 3648 = 52420160kb
> total init_memory_mapping is 50323008kb
>
> 52420160kb - 50323008kb = 2097152kb = 2G
>
> However I haven't find a better way to fix it, any ideas?
>
> Thanks,
> Xishi Qiu
>
>
> .
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] mm: direct mapping count in /proc/meminfo is error
@ 2015-11-20  8:43   ` Tang Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Tang Chen @ 2015-11-20  8:43 UTC (permalink / raw)
  To: Xishi Qiu, Andrew Morton, zhong jiang, Minchan Kim, Mel Gorman
  Cc: Linux MM, LKML

Hi Shi,

Would you please share where did you add the printk debug info ?

Thanks. :)

On 11/20/2015 04:17 PM, Xishi Qiu wrote:
> I find the direct mapping count in /proc/meminfo is error.
> The value should be equal to the size of init_memory_mapping which
> showed in boot log.
>
> I add some print to show direct_pages_count[] immediately after
> init_memory_mapping(). The reason is that we double counting.
>
> Here is the log(kernel v4.4):
> ...
> [    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]  // called from "init_memory_mapping(0, ISA_END_ADDRESS);"
> [    0.000000]  [mem 0x00000000-0x000fffff] page 4k
> [    0.000000] BRK [0x01ebf000, 0x01ebffff] PGTABLE
> [    0.000000] BRK [0x01ec0000, 0x01ec0fff] PGTABLE
> [    0.000000] BRK [0x01ec1000, 0x01ec1fff] PGTABLE
> [    0.000000] init_memory_mapping: [mem 0xc3fe00000-0xc3fffffff]  // called from "memory_map_top_down(ISA_END_ADDRESS, end);"
> [    0.000000]  [mem 0xc3fe00000-0xc3fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) one time
> [    0.000000] init_memory_mapping: [mem 0xc20000000-0xc3fdfffff]
> [    0.000000]  [mem 0xc20000000-0xc3fdfffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) two time
> [    0.000000] init_memory_mapping: [mem 0x00100000-0xbf78ffff]
> [    0.000000]  [mem 0x00100000-0x001fffff] page 4k
> [    0.000000]  [mem 0x00200000-0x3fffffff] page 2M
> [    0.000000]  [mem 0x40000000-0x7fffffff] page 1G
> [    0.000000]  [mem 0x80000000-0xbf5fffff] page 2M
> [    0.000000]  [mem 0xbf600000-0xbf78ffff] page 4k
> [    0.000000] init_memory_mapping: [mem 0x100000000-0xc1fffffff]
> [    0.000000]  [mem 0x100000000-0xc1fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) three time
> ...
> [    0.000000] DirectMap4k:        3648 kB
> [    0.000000] DirectMap2M:     2084864 kB
> [    0.000000] DirectMap1G:    50331648 kB
>
> euler-linux:~ # cat /proc/meminfo | grep DirectMap
> DirectMap4k:       91712 kB
> DirectMap2M:     4093952 kB
> DirectMap1G:    48234496 kB
>
>
> total DirectMap is 48234496 + 4093952 + 91712 = 52420160kb
> 		    50331648 + 2084864 + 3648 = 52420160kb
> total init_memory_mapping is 50323008kb
>
> 52420160kb - 50323008kb = 2097152kb = 2G
>
> However I haven't find a better way to fix it, any ideas?
>
> Thanks,
> Xishi Qiu
>
>
> .
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] mm: direct mapping count in /proc/meminfo is error
  2015-11-20  8:43   ` Tang Chen
@ 2015-11-20  9:46     ` Xishi Qiu
  -1 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-11-20  9:46 UTC (permalink / raw)
  To: Tang Chen
  Cc: Andrew Morton, zhong jiang, Minchan Kim, Mel Gorman, Linux MM, LKML

On 2015/11/20 16:43, Tang Chen wrote:

> Hi Shi,
> 
> Would you please share where did you add the printk debug info ?
> 

Sure, at the end of init_mem_mapping(), I add a new function, like arch_report_meminfo(),
just change "seq_printf" to "printk".

Thanks,
Xishi Qiu

> Thanks. :)
> 
> On 11/20/2015 04:17 PM, Xishi Qiu wrote:
>> I find the direct mapping count in /proc/meminfo is error.
>> The value should be equal to the size of init_memory_mapping which
>> showed in boot log.
>>
>> I add some print to show direct_pages_count[] immediately after
>> init_memory_mapping(). The reason is that we double counting.
>>
>> Here is the log(kernel v4.4):
>> ...
>> [    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]  // called from "init_memory_mapping(0, ISA_END_ADDRESS);"
>> [    0.000000]  [mem 0x00000000-0x000fffff] page 4k
>> [    0.000000] BRK [0x01ebf000, 0x01ebffff] PGTABLE
>> [    0.000000] BRK [0x01ec0000, 0x01ec0fff] PGTABLE
>> [    0.000000] BRK [0x01ec1000, 0x01ec1fff] PGTABLE
>> [    0.000000] init_memory_mapping: [mem 0xc3fe00000-0xc3fffffff]  // called from "memory_map_top_down(ISA_END_ADDRESS, end);"
>> [    0.000000]  [mem 0xc3fe00000-0xc3fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) one time
>> [    0.000000] init_memory_mapping: [mem 0xc20000000-0xc3fdfffff]
>> [    0.000000]  [mem 0xc20000000-0xc3fdfffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) two time
>> [    0.000000] init_memory_mapping: [mem 0x00100000-0xbf78ffff]
>> [    0.000000]  [mem 0x00100000-0x001fffff] page 4k
>> [    0.000000]  [mem 0x00200000-0x3fffffff] page 2M
>> [    0.000000]  [mem 0x40000000-0x7fffffff] page 1G
>> [    0.000000]  [mem 0x80000000-0xbf5fffff] page 2M
>> [    0.000000]  [mem 0xbf600000-0xbf78ffff] page 4k
>> [    0.000000] init_memory_mapping: [mem 0x100000000-0xc1fffffff]
>> [    0.000000]  [mem 0x100000000-0xc1fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) three time
>> ...
>> [    0.000000] DirectMap4k:        3648 kB
>> [    0.000000] DirectMap2M:     2084864 kB
>> [    0.000000] DirectMap1G:    50331648 kB
>>
>> euler-linux:~ # cat /proc/meminfo | grep DirectMap
>> DirectMap4k:       91712 kB
>> DirectMap2M:     4093952 kB
>> DirectMap1G:    48234496 kB
>>
>>
>> total DirectMap is 48234496 + 4093952 + 91712 = 52420160kb
>>             50331648 + 2084864 + 3648 = 52420160kb
>> total init_memory_mapping is 50323008kb
>>
>> 52420160kb - 50323008kb = 2097152kb = 2G
>>
>> However I haven't find a better way to fix it, any ideas?
>>
>> Thanks,
>> Xishi Qiu
>>
>>
>> .
>>
> 
> 
> .
> 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] mm: direct mapping count in /proc/meminfo is error
@ 2015-11-20  9:46     ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-11-20  9:46 UTC (permalink / raw)
  To: Tang Chen
  Cc: Andrew Morton, zhong jiang, Minchan Kim, Mel Gorman, Linux MM, LKML

On 2015/11/20 16:43, Tang Chen wrote:

> Hi Shi,
> 
> Would you please share where did you add the printk debug info ?
> 

Sure, at the end of init_mem_mapping(), I add a new function, like arch_report_meminfo(),
just change "seq_printf" to "printk".

Thanks,
Xishi Qiu

> Thanks. :)
> 
> On 11/20/2015 04:17 PM, Xishi Qiu wrote:
>> I find the direct mapping count in /proc/meminfo is error.
>> The value should be equal to the size of init_memory_mapping which
>> showed in boot log.
>>
>> I add some print to show direct_pages_count[] immediately after
>> init_memory_mapping(). The reason is that we double counting.
>>
>> Here is the log(kernel v4.4):
>> ...
>> [    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]  // called from "init_memory_mapping(0, ISA_END_ADDRESS);"
>> [    0.000000]  [mem 0x00000000-0x000fffff] page 4k
>> [    0.000000] BRK [0x01ebf000, 0x01ebffff] PGTABLE
>> [    0.000000] BRK [0x01ec0000, 0x01ec0fff] PGTABLE
>> [    0.000000] BRK [0x01ec1000, 0x01ec1fff] PGTABLE
>> [    0.000000] init_memory_mapping: [mem 0xc3fe00000-0xc3fffffff]  // called from "memory_map_top_down(ISA_END_ADDRESS, end);"
>> [    0.000000]  [mem 0xc3fe00000-0xc3fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) one time
>> [    0.000000] init_memory_mapping: [mem 0xc20000000-0xc3fdfffff]
>> [    0.000000]  [mem 0xc20000000-0xc3fdfffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) two time
>> [    0.000000] init_memory_mapping: [mem 0x00100000-0xbf78ffff]
>> [    0.000000]  [mem 0x00100000-0x001fffff] page 4k
>> [    0.000000]  [mem 0x00200000-0x3fffffff] page 2M
>> [    0.000000]  [mem 0x40000000-0x7fffffff] page 1G
>> [    0.000000]  [mem 0x80000000-0xbf5fffff] page 2M
>> [    0.000000]  [mem 0xbf600000-0xbf78ffff] page 4k
>> [    0.000000] init_memory_mapping: [mem 0x100000000-0xc1fffffff]
>> [    0.000000]  [mem 0x100000000-0xc1fffffff] page 1G  // increase count of PG_LEVEL_1G in c00000000(48G)-c3fffffff(49G) three time
>> ...
>> [    0.000000] DirectMap4k:        3648 kB
>> [    0.000000] DirectMap2M:     2084864 kB
>> [    0.000000] DirectMap1G:    50331648 kB
>>
>> euler-linux:~ # cat /proc/meminfo | grep DirectMap
>> DirectMap4k:       91712 kB
>> DirectMap2M:     4093952 kB
>> DirectMap1G:    48234496 kB
>>
>>
>> total DirectMap is 48234496 + 4093952 + 91712 = 52420160kb
>>             50331648 + 2084864 + 3648 = 52420160kb
>> total init_memory_mapping is 50323008kb
>>
>> 52420160kb - 50323008kb = 2097152kb = 2G
>>
>> However I haven't find a better way to fix it, any ideas?
>>
>> Thanks,
>> Xishi Qiu
>>
>>
>> .
>>
> 
> 
> .
> 



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-20  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20  8:17 [RFC] mm: direct mapping count in /proc/meminfo is error Xishi Qiu
2015-11-20  8:17 ` Xishi Qiu
2015-11-20  8:43 ` Tang Chen
2015-11-20  8:43   ` Tang Chen
2015-11-20  9:46   ` Xishi Qiu
2015-11-20  9:46     ` Xishi Qiu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.