Before the rework of the page daemon control loop, we would compute the
inactive queue scan target after running lowmem handlers, which will
generally free pages (i.e., shrink the difference
vmd_free_target - vmd_free_count). Now, we run the PID controller
before running lowmem handlers, so we may potentially overshoot the
target. On systems where many pages are reclaimed from lowmem handlers
(i.e., the ARC), the current behaviour may lead to excessive swapping in
response to pressure to reclaim pages from the inactive queue. To fix
this, predicate execution of lowmem handlers on a positive error in the
PID controller.
Also fix a related problem: currently, lowmem handlers are only ever
executed by the domain 0 page daemon. This means that lowmem handlers
only ever get executed in response to a shortage of free pages in domain
0. Allow any page daemon thread to execute lowmem handlers, and use an
atomic to ensure that only one attempt is made per lowmem period. To do
this, I switched back to using ticks; lowmem_uptime is a time_t, and the
platform-dependent width of this type makes it difficult to use atomics.