The real-kernel madvise and mcontrol system calls handle SMP interactions
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 2 Jul 2007 02:23:00 +0000 (02:23 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 2 Jul 2007 02:23:00 +0000 (02:23 +0000)
commitd5b116a0b4ef3825fb20c0b0afd6279fe18307f9
treec6470d2f4ddfe45a6311c632c017a4ece6c2e473
parent9a5bae71a70c31e8ea5aafed0b827c4b28291510
The real-kernel madvise and mcontrol system calls handle SMP interactions
when manipulating virtual page tables.  Construct a new set of functions
for the virtual kernel to take advantage of this.

Add a cpu cache mask to the pmap structure for the virtual kernel which
allows us to invalidate per-cpu page table mappings simply by clearing
the mask.  Also reload PT1pde after a successful cache hit if the cpu
mask bit is found to be 0.

Redo most of the PTE handling code for the virtual kernel.  Use the new
invalidation function set and carefully deal with race conditions between
cpus.  Race conditions are far more serious with a SMP virtual kernel then
with a real kernel because there are effectively two levels of page table
caching instead of one, since the real kernel maintains a separate pmap
for each VM space under the virtual kernel's control in addition to the
standard TLB interactions.
sys/platform/vkernel/include/pmap_inval.h
sys/platform/vkernel/platform/pmap.c
sys/platform/vkernel/platform/pmap_inval.c
sys/vm/vm_page.c