sync & sort distrib
Fixup fallout from km changes.

UVM_KMF_TRYLOCK is gone, so use UVM_FLAG_TRYLOCK instead, they
used to be identical.
Enable amas.

It is a tiny device that provides memory layout information.
Make all callers of appropriate pmap functions call pmap_update().

many places called pmap functions without calling pmap_update(), fix
this.  This patch doesn't yet do the hibernate code but the rest of the
kernel should be clean.
Remove some unused variables

Missed when thib removed the proc argument to vnode functions.
Remove spurious calls to pmap

This commit is the result of an audit of callers of
pmap_clear_reference() and pmap_page_protect(,,VM_PROT_NONE)

Remove a bunch of uneeded calls to pmap_clear_reference():
In uvm_anon.c and uvm_aobj.c it is only called on swapoff. We don't

really require the reference cleared if it has been accessed. doesn't
matter. and if it was just swapped then the page won't be deactivated
and it'll be freshly cleared again. However, it is possible that this
code is still wrong: deactivating something we just swapped in is wrong,
since it isn't swapped out and has no backing store. a deactivated page
mean we can dump them at will.

With pmap_page_protect, every caller of uvm_pagedeactivate first calls
pmap_page_protect. This is techinically incorrect, but done due to pmap
bugs.  move the page protect call into uvm_pagedeactivate itself and
detail with an XXX comment why this is wrong.
Move the uvm_pagealloc reserve handling to pmemrange.

This way all allocations get the benefit so they can't starve important
processes when we are close to memory starvation.

This adds a usereserve flag to the pmemrange/pglistalloc flags.

The semantics also change slightly. We no longer give reserve pages to
allocations into the kernel object, leaving reserve for pmap (and other
uses of the usereserve flag) and the pagedaemon. Finally, fix a bug
where we could deny the pagedaemon memory when there was stil left by
implicitly counting the pagedaemon has being allowed the reserve,
previousy the check was backwards.

Since pmemrange allocates multiple pages the check has to be for if (free <=
limit + sizeof(allocation)) now.

much discussion with ariane@
Switch uvm object locks to mutexes.

Instead of (noop) simple_locks. Add a number of asserts (turned on with
UWM_LOCKDEBUG) to ensure that the assumptions hold.

A number of fixes came up during review from ariane; thanks to her for that.
Convert the pageqlock back to a mutex.

This was backed out originally because arm and m68k had cases where this
would recurse due to how pmap was allocating pages. arm was fixedm 68k
wasn't, but since neitehr are supported archs right now this is no
longer an issue.
use a IPL_VM mutex for kentry_lock instead of a simple_lock and splvm()
Add an IPL_VM mutex to INTRSAFE uvm_maps and use it for locking.

The rwlock is still used for non intrsafe maps.
pageable intrsafe maps are invalid, assert this.
first attempt to kill -no-integrated-asm
clangcpp doesn't expand but will $(SYS___threxit)
Turn the spinlock into an actual spinlock.

Aka make it spin before yielding.
If there's only 1 cpu, don't spin at all (this is done using a syscall).
Execute the 'pause' instruction between spins, as freebsd does.
unifdef __HAVE_TIMECOUNTER.

All supported archs have it.
Fix include for thread_md.h
missing includes in rthreads
Revert a few premature rthread changes.

Revert "Turn the spinlock into an actual spinlock."
This reverts commit 92f9c771651fa53330e271f4b7bd11dc97f0f20f.

Revert "Fix include for thread_md.h"
This reverts commit 089d47e06e9455853fdc2048464c95560747023c.

Revert "missing includes in rthreads"
This reverts commit 55b2b429794fcb4a05dce3bff1acc9e2c70404c9.
Fix copy/pasto.

Wrong argument name in mutex assert macros.