kernel - Expand page count fields to 64 bits
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 4 Dec 2017 01:14:15 +0000 (17:14 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 4 Dec 2017 01:14:15 +0000 (17:14 -0800)
commitb7ea2f3f550021bfaabd8ed8d50b54c157fb55bf
tree72700bbb7ac45dce1dd13706ad277f84a7bb6703
parent661515fb9f6a5d266f78ed020d9b37148479d0bf
kernel - Expand page count fields to 64 bits

* 32 bit page count fields limit us to 8TB of ram.  Expand to allow
  up to the DMAP limit (32TB).  Do an initial pass on various page
  count fields and change them from int's to long's or vm_pindex_t's.

* Fix a 32-bit overflow in the pv_entry initialization code.

  pv_entry_max = shpgperproc * maxproc + vm_page_array_size;
  2000 * 1046516 + pages_of_phys_memory;

  maxproc is 1046516 @ 512GB.  This calculation overflows its 32
  bit signed variable somewhere between 256G and 512G of ram.  This
  can lead to a zinitna() allocation in pvzone that is much too
  large.

Reported-by: zrj
sys/platform/pc64/x86_64/pmap.c
sys/platform/vkernel64/platform/pmap.c
sys/sys/vmmeter.h
sys/vm/vm_contig.c
sys/vm/vm_meter.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_page2.h
sys/vm/vm_pageout.c