kernel - pmap (i386) - Reduce kmem use for foreign pmap mapping
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 4 Mar 2010 01:53:37 +0000 (17:53 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 4 Mar 2010 01:53:37 +0000 (17:53 -0800)
commit9388fcaad1973ace4809da7b52f7f0e56ed0a69e
tree10ae71fbf0a9a10ac2fd75d5d22243902a676b13
parentb527c4c540cc186db2c8aa7105d074135e7b8ea5
kernel - pmap (i386) - Reduce kmem use for foreign pmap mapping

* We've been having problems running out of KVA on i386 systems due to
  numerous reasons.  KVA use by the kernel is just too tight.

* Reserve space for foreign pmap page table mappings on a cpu-by-cpu basis
  instead of for SMP_MAXCPU.  This reduces KVM use from 68MB to (ncpu*4MB).
  Use the APT entry for cpu0 and use kmem_alloc_nofault() for the APs.

  This frees up 52MB of KVA which doesn't sound like a lot but actually
  is.

* Add an alignment argument to kmem_alloc_nofault() and vm_map_find().

* vm_map_findspace() already had an alignment argument, but adjust the
  value passed to be at least PAGE_SIZE (this has no operational effect
  but is more correct).
25 files changed:
sys/bus/pci/i386/pci_cfgreg.c
sys/bus/pci/x86_64/pci_cfgreg.c
sys/emulation/linux/i386/imgact_linux.c
sys/emulation/linux/linux_misc.c
sys/kern/imgact_gzip.c
sys/kern/init_main.c
sys/kern/kern_msfbuf.c
sys/kern/kern_sfbuf.c
sys/kern/link_elf.c
sys/kern/link_elf_obj.c
sys/kern/sys_pipe.c
sys/kern/sys_process.c
sys/kern/sysv_shm.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/include/pmap.h
sys/platform/pc64/x86_64/pmap.c
sys/platform/vkernel/platform/pmap.c
sys/vm/vm_contig.c
sys/vm/vm_extern.h
sys/vm/vm_kern.c
sys/vm/vm_map.c
sys/vm/vm_map.h
sys/vm/vm_mmap.c
sys/vm/vm_unix.c