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)
Fri, Nov 28, 1:35 AM
Unknown Object (File)
Thu, Nov 27, 5:40 AM
Unknown Object (File)
Wed, Nov 26, 1:18 AM
Unknown Object (File)
Mon, Nov 24, 5:10 PM
Unknown Object (File)
Nov 19 2025, 3:19 AM
Unknown Object (File)
Nov 14 2025, 12:23 AM
Unknown Object (File)
Oct 26 2025, 8:26 AM
Unknown Object (File)
Oct 26 2025, 3:59 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.