mmap performance and memory use

Wojciech Puchar wojtek at wojtek.tensor.gdynia.pl
Fri Oct 7 17:23:55 UTC 2011


> 
> You are correct about the page table page.  However, a superpage mapping consumes a single PV entry, in place of 512 or 1024 PV
> entries.  This winds up saving about three physical pages worth of memory for every superpage mapping.
does it actually work?

simple test

before (only idle system with 2GB RAM and most free)

vm.pmap.pde.promotions: 921
vm.pmap.pde.p_failures: 21398
vm.pmap.pde.mappings: 299
vm.pmap.pde.demotions: 596
vm.pmap.shpgperproc: 200
vm.pmap.pv_entry_max: 696561
vm.pmap.pg_ps_enabled: 1
vm.pmap.pat_works: 1


and with that program running (==sleeping)

#include <unistd.h>
int a[1<<24];
main() {
  int b;
  for(b=0;b<(1<<24);b++) a[b]=b;
  sleep(1000);
}


vm.pmap.pdpe.demotions: 0
vm.pmap.pde.promotions: 952
vm.pmap.pde.p_failures: 21398
vm.pmap.pde.mappings: 299
vm.pmap.pde.demotions: 596
vm.pmap.shpgperproc: 200
vm.pmap.pv_entry_max: 696561
vm.pmap.pg_ps_enabled: 1
vm.pmap.pat_works: 1



seems like i don't understand what these sysctl things mean (i did sysctl -d)
or it doesn't really work. with program allocating and using linear 64MB 
chunk it should be 31 or 32 more mappings in vm.pmap.pde.mappings
there are zero difference.


More information about the freebsd-hackers mailing list