My kernel is
Linux localhost.localdomain 2.6.30 #5 SMP Tue Aug 10 00:56:36 CST 2010 x86_64 x86_64 x86_64 GNU/Linux
My kernel module find a 2M page while nr_hugepages is disabled.
[root@localhost ~]# cat /proc/sys/vm/nr_hugepages
0
[root@localhost ~]# cat /proc/meminfo
...
Hugepagesize: 2048 kB
DirectMap4k: 9856 kB
DirectMap2M: 2052096 kB
I wonder whether linux64 kernel can have both 2M and 4K page together? And what’s the condition?
Yes. I believe you need to build with a special kernel setting in order to support huge page size, then allocate the #/huge pages you wish (the rest of memory will be regular, 4K pages).
Here’s are links:
http://unixfoo.blogspot.com/2007/10/hugepages.html
http://dbakerber.wordpress.com/2012/03/14/configuring-hugepages-for-oracle-on-linux/
http://lwn.net/Articles/374424/