Page MenuHomeFreeBSD

skip gratuitous inactive queueing
ClosedPublic

Authored by kmacy on Jan 25 2015, 11:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 6:48 PM
Unknown Object (File)
Fri, Mar 22, 6:48 PM
Unknown Object (File)
Fri, Mar 22, 6:48 PM
Unknown Object (File)
Sun, Mar 10, 12:37 AM
Unknown Object (File)
Wed, Feb 28, 10:49 AM
Unknown Object (File)
Wed, Feb 28, 9:03 AM
Unknown Object (File)
Dec 29 2023, 11:43 PM
Unknown Object (File)
Dec 29 2023, 11:43 PM
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.