Page MenuHomeFreeBSD

Fix some issues in vm_pqbatch_process_page().
ClosedPublic

Authored by markj on Aug 22 2019, 6:48 PM.

Details

Summary

Don't bother masking off the non-queue state bits. It is not necessary
in non-INVARIANTS kernels, so just perform the mask in the assertions
instead.

Remove a comment about the order in which we set and clear flags. It
applies to an earlier version of the batched processing that I did, but
now it is only ever safe to test for or toggle PGA_ENQUEUED with the
page queue lock held.

Avoid unconditionally clearing both PGA_REQUEUE and PGA_REQUEUE_HEAD.
It is possible that another thread is concurrently setting
PGA_REQUEUE_HEAD and submitting a batch entry while
vm_pqbatch_process_page() is applying PGA_REQUEUE.

Test Plan

Peter is testing the patch.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj created this revision.Aug 22 2019, 6:48 PM
markj edited the test plan for this revision. (Show Details)Aug 22 2019, 6:48 PM
markj added reviewers: kib, alc, dougm.
kib accepted this revision.Aug 22 2019, 7:12 PM
kib added inline comments.
sys/vm/vm_page.c
3088 ↗(On Diff #61127)

() around '&' are excessive. May be print raw qflags value instead, just in case.

This revision is now accepted and ready to land.Aug 22 2019, 7:12 PM
markj added inline comments.Thu, Aug 22, 10:14 PM
sys/vm/vm_page.c
3088 ↗(On Diff #61127)

I will fix it before committing.

alc added inline comments.Thu, Aug 22, 10:46 PM
sys/vm/vm_page.c
3109–3110 ↗(On Diff #61127)

In effect, PGA_REQUEUE_HEAD takes precedence over PGA_REQUEUE. I would suggest adding a comment to that effect.

markj updated this revision to Diff 61172.Fri, Aug 23, 4:40 PM
markj marked 2 inline comments as done.

Address feedback.

This revision now requires review to proceed.Fri, Aug 23, 4:40 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Aug 26, 8:20 PM
This revision was automatically updated to reflect the committed changes.