Page MenuHomeFreeBSD

Fix cv_waiters wraparound bug
ClosedPublic

Authored by markj on Jan 8 2016, 12:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Aug 5, 6:23 PM
Unknown Object (File)
Mon, Aug 4, 1:56 AM
Unknown Object (File)
Fri, Jul 25, 2:37 AM
Unknown Object (File)
Jul 6 2025, 10:46 AM
Unknown Object (File)
Jul 5 2025, 12:03 PM
Unknown Object (File)
Jul 4 2025, 6:38 PM
Unknown Object (File)
Jul 4 2025, 1:16 PM
Unknown Object (File)
Jul 3 2025, 9:53 AM
Subscribers

Details

Summary

This is another attempt to fix the issue described in r282971, which was
reverted in r283250. Rather than eliminating cv_waiters entirely, cap
its value at INT_MAX and modify cv_signal() to handle that case
appropriately. In particular, this lets us avoid looking up the
sleepqueue on every call to cv_signal().

Diff Detail

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

Event Timeline

markj retitled this revision from to Fix cv_waiters wraparound bug.
markj edited the test plan for this revision. (Show Details)
markj updated this object.

Don't assert cv_waiters == 0 in cv_destroy().

It may be non-zero even with zero sleepers, since threads don't
decrement it when they wake up.

jhb edited edge metadata.
This revision is now accepted and ready to land.Jan 8 2016, 6:56 PM
This revision was automatically updated to reflect the committed changes.