Page MenuHomeFreeBSD

Do not clear page flags in vm_page_pqbatch_submit().
ClosedPublic

Authored by markj on Aug 22 2019, 7:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 6:45 AM
Unknown Object (File)
Oct 31 2023, 8:05 PM
Unknown Object (File)
Oct 31 2023, 5:26 AM
Unknown Object (File)
Oct 6 2023, 5:45 AM
Unknown Object (File)
Sep 29 2023, 3:16 AM
Unknown Object (File)
Jun 3 2023, 8:02 AM
Unknown Object (File)
May 14 2023, 6:36 PM
Unknown Object (File)
Dec 27 2022, 8:05 PM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj edited the test plan for this revision. (Show Details)

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?

This revision is now accepted and ready to land.Aug 22 2019, 9:02 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.