kernel - VM rework part 14 - Core pmap work, stabilize for X/drm
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 20 May 2019 01:48:30 +0000 (18:48 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 20 May 2019 19:39:25 +0000 (12:39 -0700)
commitf16f9121796592a356f4962da34e7071339e4e1f
treeab9390f208e4314d0c7930de15f02a98d3de38db
parente32fb2aa5ec45f533085d913b32f3b5b441047fe
kernel - VM rework part 14 - Core pmap work, stabilize for X/drm

* Don't gratuitously change the vm_page flags in the drm code.

  The vm_phys_fictitious_reg_range() code in drm_vm.c was clearing
  PG_UNMANAGED.  It was only luck that this worked before, but
  because these are faked pages, PG_UNMANAGED must be set or the
  system will implode trying to convert the physical address back
  to a vm_page in certain routines.

  The ttm code was setting PG_FICTITIOUS in order to prevent the
  page from getting into the active or inactive queues (they had
  a conditional test for PG_FICTITIOUS).  But ttm never cleared
  the bit before freeing the page.  Remove the hack and instead
  fix it in vm_page.c

* in vm_object_terminate(), allow the case where there are still
  wired pages in a OBJT_MGTDEVICE object that has wound up on a
  queue (don't complain about it).  This situation arises because the
  ttm code uses the contig malloc API which returns wired pages.

  NOTE: vm_page_activate()/vm_page_deactivate() are allowed to mess
with wired pages.  Wired pages are not anything 'special' to
the queues, which allows us to avoid messing with the queues
when pages are assigned to the buffer cache.
sys/dev/drm/drm_vm.c
sys/dev/drm/ttm/ttm_page_alloc.c
sys/platform/pc64/x86_64/pmap.c
sys/vm/device_pager.c
sys/vm/vm_page.c