Page MenuHomeFreeBSD

Slightly simplify page queue code.
ClosedPublic

Authored by markj on Aug 20 2019, 2:36 PM.
Tags
None
Referenced Files
F114693938: D21341.id61046.diff
Tue, Apr 15, 1:35 PM
F114667866: D21341.diff
Tue, Apr 15, 3:52 AM
F114667596: D21341.id.diff
Tue, Apr 15, 3:49 AM
F114667405: D21341.id61046.diff
Tue, Apr 15, 3:46 AM
F114667188: D21341.id61044.diff
Tue, Apr 15, 3:43 AM
F114667077: D21341.id61055.diff
Tue, Apr 15, 3:41 AM
F114666961: D21341.id61080.diff
Tue, Apr 15, 3:40 AM
Unknown Object (File)
Fri, Apr 11, 1:07 PM
Subscribers

Details

Summary
  • Add vm_pagequeue_remove(), which updates page queue state as required when removing a page.
  • Get rid of vm_page_pagequeue_lockptr(). When I added it I planned to use it more widely, but it is only used in vm_page_dequeue(). Modify vm_page_pagequeue() to handle a queue index of PQ_NONE, and use it instead. Make it local to vm_page.c; there are no external consumers and page queue management should be limited to vm_page.c and vm_pageout.c.

No functional change intended.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25985
Build 24540: arc lint + arc unit

Event Timeline

sys/vm/vm_page.c
3327

I'm not sure that I see the point of this assignment or the variable pq1, since the very first statement within this loop will replace the value assigned here.

  • Remove pq1.
  • Fix an assertion added in r338276. I meant to assert that either the page lock is held or that vm_page_dequeue() is being called from the page allocator. But testing m->order is not right, we have m->order == VM_NFREEORDER for any allocated page, so the assertion didn't really test anything.

Re-add pq1, and reload the page queue pointer only once if a mismatch
is detected after locking the page queue.

This revision is now accepted and ready to land.Aug 20 2019, 7:23 PM
This revision was automatically updated to reflect the committed changes.