Page MenuHomeFreeBSD

Don't preserve the page object/pindex in vm_page_insert_after()
ClosedPublic

Authored by markj on Jun 1 2016, 2:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 18 2024, 8:02 PM
Unknown Object (File)
Oct 3 2024, 10:55 PM
Unknown Object (File)
Oct 1 2024, 12:02 PM
Unknown Object (File)
Sep 27 2024, 10:28 AM
Unknown Object (File)
Sep 27 2024, 10:28 AM
Unknown Object (File)
Sep 27 2024, 10:23 AM
Unknown Object (File)
Sep 27 2024, 7:04 AM
Unknown Object (File)
Sep 26 2024, 6:46 AM
Subscribers

Details

Summary

Per the KASSERT at the beginning of the function, we expect that the
page does not belong to any object, so its object and pindex fields are
meaningless. Reset them in the rare case that vm_radix_insert() fails.
This is just a micro-optimization.

I note that we do not clear the pindex field when freeing a page:
vm_page_remove() only clears the object field. But resetting it here
makes the intent more clear and doesn't hurt.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4061
Build 4104: arc lint + arc unit

Event Timeline

markj retitled this revision from to Don't preserve the page object/pindex in vm_page_insert_after().
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj added reviewers: alc, kib.
kib edited edge metadata.

I am curious why the code tried to preserve the previous object and pindex, as if the page could be returned to the cache (but it never is).

This revision is now accepted and ready to land.Jun 1 2016, 3:44 AM
This revision was automatically updated to reflect the committed changes.