Page MenuHomeFreeBSD

vm_phys: drop range checks from free pages loop
Needs ReviewPublic

Authored by dougm on Jun 16 2023, 6:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 10 2024, 11:19 PM
Unknown Object (File)
Dec 26 2023, 3:37 PM
Unknown Object (File)
Nov 18 2023, 11:20 AM
Unknown Object (File)
Nov 18 2023, 10:59 AM
Unknown Object (File)
Nov 18 2023, 9:15 AM
Unknown Object (File)
Jun 20 2023, 5:07 PM
Unknown Object (File)
Jun 17 2023, 4:10 AM
Subscribers
None

Details

Reviewers
alc
Summary

The loop in vm_phys_free_pages checks pa against seg->start and seg->end with every iteration. This change precomputes which loop iteration would lead to either of those tests failing, and sets an upper bound on the number of loop iterations based on those values and VM_NFREEORDER. Then it removes those bounds checks from the loop.

Test Plan

A kernel boots.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Jun 16 2023, 6:03 AM
dougm created this revision.

Calculate the loop bound a little more efficiently. Reorder some computations within the loop to use fewer registers.