Page MenuHomeFreeBSD

umtx: Don't sleep after casueword32 failure in do_sem2_wake
ClosedPublic

Authored by bnovkov on Jan 30 2025, 4:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 2, 8:09 AM
Unknown Object (File)
Wed, Apr 1, 10:06 PM
Unknown Object (File)
Wed, Apr 1, 11:09 AM
Unknown Object (File)
Wed, Apr 1, 5:34 AM
Unknown Object (File)
Sun, Mar 29, 11:29 AM
Unknown Object (File)
Thu, Mar 26, 6:34 AM
Unknown Object (File)
Sat, Mar 21, 5:32 AM
Unknown Object (File)
Sat, Mar 21, 4:45 AM
Subscribers

Details

Summary

When a casueword32 operation fails, 'do_sem2_wake' will call
'thread_check_susp' to avoid a potential livelock. However, it
instructs 'thread_check_susp' to sleep while holding a previously busied
umtxq key. This is explicitly discouraged by the comments in
'thread_check_susp' which state that a thread shouldn't sleep if it
owns a kernel resource. Fix this by passing 'false'
to 'thread_check_susp'.

Sponsored by: Klara Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable