pass PQ_NONE to vm_page_unwire wherever we know that we're going to immediately call vm_page_free
Details
- Reviewers
alc - Commits
- rS289059: Exploit r288122 to avoid pointlessly enqueueing a page that is about to be
rS288912: Exploit r288122 to address a cosmetic issue. Pages belonging to either
rS288274: Exploit r288122 to address a cosmetic issue. Since the pages allocated
rS288256: Exploit r288122 to address a cosmetic issue. Since PV chunk pages don't
stress2 buildworld
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I think that this is a good change, but I'll make an observation: in all but a couple of these cases, the page is unmanaged. So, it never actually goes into the inactive queue when its wire count goes to zero. In other words, this change mostly addresses a code clarity problem, i.e., eliminating the appearance that we are putting about-to-be-freed pages into the inactive queue.
Elsewhere, there are places where we unwire unmanaged pages with inline code, e.g., amd64's uma_small_free, by directly updating the appropriate counters.
Thinking out loud, I wonder if creating a simple inline function whose use was restricted to unmanaged pages that didn't take a queue, e.g., vm_page_unwire_unmanaged(m), wouldn't make sense. Thoughts?
sys/kern/vfs_bio.c | ||
---|---|---|
1907 ↗ | (On Diff #3435) | wire_count == 1? |
sys/net/bpf_zerocopy.c | ||
117 ↗ | (On Diff #3435) | wire_count == 1? |
sys/kern/uipc_syscalls.c | ||
---|---|---|
1850–1866 ↗ | (On Diff #3435) | In cases like this, where we check pg->object, the page is never going into the inactive queue. Before vm_page_unwire(), enqueues the page, it does: if ((m->oflags & VPO_UNMANAGED) != 0 || m->object == NULL) return; In fact, there should never be a page in either the active or inactive queues that doesn't belong to an object. |