Page MenuHomeFreeBSD

Do not clear page flags in vm_page_pqbatch_submit().
ClosedPublic

Authored by markj on Aug 22 2019, 7:36 PM.

Details

Summary

All existing callers guarantee that the page does not have a
pre-existing dequeue pending. Thus, if the page is dequeued before
pqbatch_submit() acquires the page queue lock, we do not need to do
anything since vm_page_dequeue_complete() takes care of clearing all
page queue state flags for us.

With this change, vm_page_pqbatch_submit() has the nice property that it
does not directly modify any fields in the page structure.

Test Plan

Peter is testing the change.

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, 7:36 PM
markj edited the test plan for this revision. (Show Details)
dougm added a comment.Aug 22 2019, 8:37 PM

All existing callers guarantee that the page does not have a pre-existing dequeue pending.

Can you add a KASSERT to express that in the callee?

kib accepted this revision.Aug 22 2019, 9:02 PM
This revision is now accepted and ready to land.Aug 22 2019, 9:02 PM
markj added a comment.Aug 22 2019, 9:06 PM

All existing callers guarantee that the page does not have a pre-existing dequeue pending.

Can you add a KASSERT to express that in the callee?

I don't think it's

All existing callers guarantee that the page does not have a pre-existing dequeue pending.

Can you add a KASSERT to express that in the callee?

I don't think so. Some callers, like vm_page_dequeue_deferred(), request a dequeue by setting PGA_DEQUEUE. It is possible that a lingering batch queue entry will cause PGA_DEQUEUE to be concurrently cleared in vm_pqbatch_process_page() at any point before vm_page_pqbatch_submit() acquires the page queue lock. So I cannot think of any useful and non-racy assertions to add in place of the line I removed.

alc accepted this revision.Aug 22 2019, 10:12 PM
This revision was automatically updated to reflect the committed changes.