Page MenuHomeFreeBSD

Fix ticks wrap issue of lowmem test in vm_pageout_scan
ClosedPublic

Authored by smh on Sep 23 2014, 12:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 31, 6:35 AM
Unknown Object (File)
Dec 2 2024, 4:23 PM
Unknown Object (File)
Dec 2 2024, 4:23 PM
Unknown Object (File)
Nov 27 2024, 12:27 AM
Unknown Object (File)
Nov 14 2024, 6:35 AM
Unknown Object (File)
Oct 12 2024, 11:50 AM
Unknown Object (File)
Oct 12 2024, 10:10 AM
Unknown Object (File)
Oct 7 2024, 11:41 PM
Subscribers
None

Details

Reviewers
will
jhb

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

smh retitled this revision from to Fix ticks wrap issue of lowmem test in vm_pageout_scan.
smh updated this object.
smh edited the test plan for this revision. (Show Details)

When looking at this again, I couldn't see the issue you mentioned in IRC last night John:
[21:24] <BigSpoon> it means it only does it
[21:24] <BigSpoon> if you scan within the window
[21:24] <BigSpoon> it should be >
[21:24] <BigSpoon> not <

Have I not had enough coffee this morning?

The overflow issue was there, which I've addressed in this revision.

I had it backwards, the condition is correct. However, this is not the correct way to handle wrapping. You should always compute a tick delta and compare that instead. That is:

ticks - lowmem_ticks >= lowmem_period * hz

Will would prefer you to do a divide to avoid overflow, so that would become:

(ticks - lowmem_ticks) / hz >= lowmem_period

I think this is also easier to read and parse than the current expression (is the amount of time that has passed greater than that the throttle period?)

smh edited edge metadata.

Yep got confused looking for the range issue, updated with the recommended method for signed vals.

jhb edited edge metadata.
This revision is now accepted and ready to land.Sep 24 2014, 2:13 PM