HomeFreeBSD

Don't update per-page activation counts in the swapout code.

Description

Don't update per-page activation counts in the swapout code.

This avoids duplicating the work of the page daemon's active queue scan.
Moreover, this duplication was inconsistent:

  • PGA_REFERENCED is not counted in act_count unless pmap_ts_referenced() returned 0, but the page daemon always counts PGA_REFERENCED towards the activation count.
  • The swapout daemon always activates a referenced page, but the page daemon only does so when the containing object is mapped at least once.

The main purpose of swapout_deactivate_pages() is to shrink the number
of pages mapped into a given pmap. To do this without unmapping active
pages, use the non-destructive pmap_is_referenced() instead of the
destructive pmap_ts_referenced() and deactivate pages accordingly.
This simplifies some future changes to the locking protocol for page
queue state.

Reviewed by: kib
Discussed with: jeff
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D22674