Don't immediately enqueue pages to inactive list, instead place on a list protected by the page lock then move pages to inactive when scanning
stress2, buildworld, netflix deployment
Unit Tests Skipped
In general, I'd like to see a little stricter fixup. Either wakeup the pagedaemon once the global deferred count crosses a threshold, or directly call fixup in the enqueue.
Other than that, this looks good to me.
Since there is no lock order issue here, I'd like to see either a "forced" option to _fixup() to really collect if we are falling behind our target in the pagedaemon, or a secondary threshold that forces the consolidation (regardless of lock contention).
Read v_inactive_deferred_count instead of looking at "merged"?