Page MenuHomeFreeBSD

skip gratuitous inactive queueing
ClosedPublic

Authored by kmacy on Jan 25 2015, 11:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 12:46 PM
Unknown Object (File)
Oct 18 2024, 2:50 AM
Unknown Object (File)
Oct 7 2024, 10:44 PM
Unknown Object (File)
Oct 7 2024, 10:44 PM
Unknown Object (File)
Oct 7 2024, 10:43 PM
Unknown Object (File)
Oct 7 2024, 10:23 PM
Unknown Object (File)
Sep 27 2024, 10:17 PM
Unknown Object (File)
Sep 26 2024, 12:03 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kmacy retitled this revision from to skip gratuitous inactive queueing.
kmacy updated this object.
kmacy edited the test plan for this revision. (Show Details)
kmacy added a reviewer: alc.

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.

This revision was automatically updated to reflect the committed changes.