superpages and kmem on amd64

Marko Zec zec at
Sun May 20 07:01:51 UTC 2012

Hi all,

I'm playing with an algorithm which makes use of large contiguous blocks of 
kernel memory (ranging from 1M to 1G in size), so it would be nice if those 
could be somehow forcibly mapped to superpages.  I was hoping that the VM 
system would automagically map (merge) contiguous 4k pages to superpages, but 
apparently it doesn't:

vm.pmap.pdpe.demotions: 2
vm.pmap.pde.promotions: 543
vm.pmap.pde.p_failures: 266253
vm.pmap.pde.mappings: 0
vm.pmap.pde.demotions: 31

I.e. I have 1G of kmem allocated using via 

malloc(1024 * 1024 * 1024, M_TEMP, M_NOWAIT);

but vm.pmap.pde.mappings: 0 suggests that no superpages are in use.

Is there an alternative kernel memory allocation method which might force 
superpages to be used for contiguous memory blocks?  And how do I find more 
details about page mappings for a given kmem virtual address?  I'm running 
8.3-STABLE on amd64.



More information about the freebsd-amd64 mailing list