Page MenuHomeFreeBSD

vm_pageout_scan_active: ensure ps_delta is initialized
ClosedPublic

Authored by vangyzen on Aug 27 2020, 3:08 PM.
Tags
None
Referenced Files
F163265715: D26212.id76286.diff
Tue, Jul 21, 2:15 PM
Unknown Object (File)
Tue, Jul 21, 5:23 AM
Unknown Object (File)
Mon, Jul 20, 1:34 AM
Unknown Object (File)
Mon, Jul 13, 9:14 PM
Unknown Object (File)
Sun, Jul 5, 1:39 AM
Unknown Object (File)
Fri, Jul 3, 2:25 PM
Unknown Object (File)
Tue, Jun 23, 2:45 PM
Unknown Object (File)
Jun 10 2026, 2:20 AM
Subscribers

Details

Summary

Ensure ps_delta is initialized.

Reported by: Coverity

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/vm/vm_pageout.c
1293 ↗(On Diff #76283)

I guess this is the only case where we can end up with a bogus ps_delta. It should be quite rare.

The assignment should go here, not at the top of the loop. We only break from the loop when the atomic_fcmpset at the end succeeds. In one iteration we might set ps_delta to a nonzero value, fail the update, and then exit the loop through this case, in which case ps_delta will be left equal to the old and now-incorrect value.

  • move init to the right place
vangyzen added inline comments.
sys/vm/vm_pageout.c
1293 ↗(On Diff #76283)

Indeed. Thank you.

This revision is now accepted and ready to land.Aug 27 2020, 4:34 PM
This revision was automatically updated to reflect the committed changes.
vangyzen marked an inline comment as done.