Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2012 09:01:32 +0200
From:      Marko Zec <zec@fer.hr>
To:        <freebsd-hackers@freebsd.org>
Cc:        freebsd-amd64@freebsd.org
Subject:   superpages and kmem on amd64
Message-ID:  <201205200901.32613.zec@fer.hr>

next in thread | raw e-mail | index | archive | help
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.

Thanks,

Marko



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205200901.32613.zec>