HomeFreeBSD

Simplify vm_page_dequeue() and fix an assertion.

Description

Simplify vm_page_dequeue() and fix an assertion.

  • Add a vm_pagequeue_remove() function to physically remove a page from its queue and update the queue length.
  • Remove vm_page_pagequeue_lockptr() and let vm_page_pagequeue() return NULL for dequeued pages.
  • Avoid unnecessarily reloading the queue index if vm_page_dequeue() loses a race with a concurrent queue operation.
  • Correct an always-true assertion: vm_page_dequeue() may be called from the page allocator with the page unlocked. The assertion m->order == VM_NFREEORDER simply tests whether the page has been removed from the vm_phys free lists; instead, check whether the page belongs to an object.

Reviewed by: kib
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21341

Details

Provenance
markjAuthored on
Reviewer
kib
Differential Revision
D21341: Slightly simplify page queue code.
Parents
rS351332: Unconditionally enable debug.vm_lowmem.
Branches
Unknown
Tags
Unknown