git: kernel - pmap and vkernel work
dillon at crater.dragonflybsd.org
Tue Jan 24 20:14:16 PST 2017
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Mon Jan 23 12:20:23 2017 -0800
kernel - pmap and vkernel work
* Remove the pmap.pm_token entirely. The pmap is currently protected
primarily by fine-grained locks and the vm_map lock. The intention
is to eventually be able to protect it without the vm_map lock at all.
* Enhance pv_entry acquisition (representing PTE locations) to include
a placemarker facility for non-existant PTEs, allowing the PTE location
to be locked whether a pv_entry exists for it or not.
* Fix dev_dmmap (struct dev_mmap) (for future use), it was returning a
page index for physical memory as a 32-bit integer instead of a 64-bit
* Use pmap_kextract() instead of pmap_extract() where appropriate.
* Put the token contention test back in kern_clock.c for real kernels
so token contention shows up as sys% instead of idle%.
* Modify the pmap_extract() API to also return a locked pv_entry,
and add pmap_extract_done() to release it. Adjust users of
* Change madvise/mcontrol MADV_INVAL (used primarily by the vkernel)
to use a shared vm_map lock instead of an exclusive lock. This
significantly improves the vkernel's performance and significantly
reduces stalls and glitches when typing in one under heavy loads.
* The new placemarkers also have the side effect of fixing several
difficult-to-reproduce bugs in the pmap code, by ensuring that
shared and unmanaged pages are properly locked whereas before only
managed pages (with pv_entry's) were properly locked.
* Adjust the vkernel's pmap code to use atomic ops in numerous places.
* Rename the pmap_change_wiring() call to pmap_unwire(). The routine
was only being used to unwire (and could only safely be called for
unwiring anyway). Remove the unused 'wired' and the 'entry'
Also change how pmap_unwire() works to remove a small race condition.
* Fix race conditions in the vmspace_*() system calls which could lead
to pmap corruption. Note that the vkernel did not trigger any of
these conditions, I found them while looking for another bug.
* Add missing maptypes to procfs's /proc/*/map report.
Summary of changes:
sys/bus/isa/vga_isa.c | 3 +-
sys/bus/isa/x86_64/isa_dma.c | 4 +-
sys/cpu/x86_64/include/types.h | 1 +
sys/emulation/ndis/subr_ntoskrnl.c | 4 +-
sys/kern/kern_clock.c | 16 +-
sys/kern/kern_device.c | 2 +-
sys/kern/subr_sglist.c | 27 +-
sys/platform/pc64/include/pmap.h | 12 +-
sys/platform/pc64/x86_64/busdma_machdep.c | 2 +-
sys/platform/pc64/x86_64/pmap.c | 974 ++++++++++++++---------
sys/platform/pc64/x86_64/vm_machdep.c | 2 +-
sys/platform/vkernel64/include/pmap.h | 1 -
sys/platform/vkernel64/platform/busdma_machdep.c | 2 +-
sys/platform/vkernel64/platform/pmap.c | 76 +-
sys/platform/vkernel64/x86_64/vm_machdep.c | 6 +-
sys/sys/device.h | 4 +-
sys/sys/globaldata.h | 3 +-
sys/sys/vkernel.h | 9 +-
sys/vfs/procfs/procfs_map.c | 16 +-
sys/vm/device_pager.c | 3 +-
sys/vm/pmap.h | 6 +-
sys/vm/vm_contig.c | 2 +-
sys/vm/vm_fault.c | 27 +-
sys/vm/vm_map.c | 92 ++-
sys/vm/vm_object.c | 3 +-
sys/vm/vm_object.h | 2 +-
sys/vm/vm_vmspace.c | 185 +++--
27 files changed, 919 insertions(+), 565 deletions(-)
DragonFly BSD source repository
More information about the Commits