Instead, let the page daemon lazily dequeue any wired pages that it
encounters. vm_page_unwire() is modified to requeue the page, preserving
LRU. This improves scability quite a bit in some benchmarks, for example
when the workload involves the buffer cache and the working set size
exceeds the configured buffer limit. In this case, multiple threads will
be wiring pages into the buffer cache while the buf daemon evicts them.
Without this change, all of these threads contend heavily on the global
inactive queue lock; with the change, only the buf daemon needs to
interact with the inactive queue.
The change has the potential drawback of causing the page daemon to do
more work, since it may potentially encounter many wired pages during an
inactive queue scan. However, I think this is still the right tradeoff
to make from a scalability perspective, and the page daemon can check
wire_count before attempting to acquire the VM object lock.
I think this patch is still pretty rough and not committable as-is. I
haven't yet implemented Alan's suggestion of avoiding the requeue when
the page belongs to PQ_ACTIVE.