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)
Thu, Mar 28, 2:38 PM
Unknown Object (File)
Dec 20 2023, 1:18 AM
Unknown Object (File)
Jun 26 2023, 11:53 PM
Unknown Object (File)
Jun 26 2023, 11:52 PM
Unknown Object (File)
Jun 26 2023, 11:52 PM
Unknown Object (File)
Jun 26 2023, 11:52 PM
Unknown Object (File)
Jun 26 2023, 11:39 PM
Unknown Object (File)
May 14 2023, 6:26 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

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

Event Timeline

kib added inline comments.
sys/vm/vm_page.c
3178 ↗(On Diff #53544)

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.