Page MenuHomeFreeBSD

Allow vm_page_free_prep() to dequeue pages without the page lock.
ClosedPublic

Authored by markj on Feb 2 2019, 7:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 10:33 AM
Unknown Object (File)
Sun, Apr 21, 4:10 AM
Unknown Object (File)
Sun, Apr 21, 4:10 AM
Unknown Object (File)
Sun, Apr 21, 4:09 AM
Unknown Object (File)
Sun, Apr 21, 3:57 AM
Unknown Object (File)
Sun, Apr 21, 3:13 AM
Unknown Object (File)
Sun, Apr 21, 2:53 AM
Unknown Object (File)
Thu, Mar 28, 2:38 PM
Subscribers

Details

Summary

This is a step towards being able to free pages without holding the page
lock. Once hold_count/wire_count are merged and the PG_UNHOLDFREE
mechanism is removed, only the vm_page_remove() call will require the
page lock, and this will be dealt with separately.

The approach is simply to add an implementation of
vm_page_dequeue_deferred() which does not assert that the page lock is
held. Formally, we require the page lock in order to set PGA_DEQUEUE.
(The page queue lock is required to clear the flag and assign
m->queue = PQ_NONE.) However, if the page is being freed, we can
assume that no other thread is concurrently scheduling a queue operation
for the page, so we have mutual exclusion anyway.

No functional change intended.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22331
Build 21512: arc lint + arc unit

Event Timeline

kib added inline comments.
sys/vm/vm_page.c
3178–3182

I think it would be useful to assert that the page passed to vm_pgbatch* is managed.

This revision is now accepted and ready to land.Feb 2 2019, 8:01 PM
markj marked an inline comment as done.
  • Assert that we don't batch operations on unmanaged pages.
  • Reword a comment.
This revision now requires review to proceed.Feb 3 2019, 6:10 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 3 2019, 6:43 PM
This revision was automatically updated to reflect the committed changes.