Page MenuHomeFreeBSD

vm_object: drop reverse walk from collect_flush
ClosedPublic

Authored by dougm on May 24 2025, 9:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 6:00 AM
Unknown Object (File)
Wed, Oct 1, 10:29 PM
Unknown Object (File)
Tue, Sep 30, 9:48 PM
Unknown Object (File)
Tue, Sep 30, 6:59 PM
Unknown Object (File)
Tue, Sep 30, 8:54 AM
Unknown Object (File)
Thu, Sep 25, 4:38 PM
Unknown Object (File)
Tue, Sep 23, 6:20 PM
Unknown Object (File)
Wed, Sep 17, 6:34 AM
Subscribers

Details

Summary

In vm_object_page_collect_flush, following a forward walk from page p seeking more pages to which vm_object_page_remove_write might be applied, a backward walk from page p is attempted. It never finds a page, and so this change removes that walk.

It never finds a page because collect_flush() is only called from one place, in vm_object_page_clean(). If there was a page p-1 to be found, then either it is less than tstart, or it would have been found in the previous iteration. If it less than tstart, then page_clean() shouldn't be messing with it. If it was found in the previous iteration, then vm_object_page_collect_flush() would have been called in that iteration, and page p would have been the first page in the forward walk from p-1, and it would have been processed then, and so p would not be passed to vm_object_page_collect_flush now.

Test Plan

I ran some buildworlds and counted the number of 'prev' pages that were processed, finding that there were none.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.May 24 2025, 9:59 PM
dougm created this revision.

I think this is ok. I might also try to signal that vm_object_page_collect_flush() is a helper function for vm_object_page_clean(), e.g., by moving it above the latter and/or renaming it to vm_object_page_clean_flush(), the notion being that the reverse walk makes some sense in a more general-purpose helper function, but not if it's intended to be called only from vm_object_page_clean().

This revision is now accepted and ready to land.May 25 2025, 10:24 PM