kernel - Implement segment pmap optimizations for x86-64 (6)
* Improve process exit. When the last process referencing a shared
anonymous memory VM object exits the kernel destroys the object
and its shared pmap.
Removal of pages from the shared pmap was causing the system to IPI
EVERY cpu for EACH pte. Needless to say this caused a process to take
~2 minutes to remove a ~6GB shared segment. Optimize this case by
not bothering the do the IPI/invlpg invalidations since the pmap is not
actually active.
* This also applies to any exiting process. When cleaning out the pmap
we no longer invlpg each pte, since nobody is referencing the pmap except
the current thread in the kernel doing the exit. It will simply issue
a cpu_invltlb() when it is all done.