checklocks: clarify futex bucket contracts - #14298
Closed
tamird wants to merge 2 commits into
Closed
Conversation
Contributor
Author
|
r? @EtiennePerot Could you review PI helper lock requirements and conditional bucket aliases? Focused local Bazel checks passed. Upstream checks have not reported yet. Assisted-by: Codex |
Recognize atomicbitops Racy methods as non-atomic operations. Permit mixed-mode RacyLoad only when all guards are held, and require atomic writes with all guards held exclusively. Distinguish shared-lock reads from lock-free atomic reads so an RLock cannot authorize writes. Check atomic uses of annotated globals at the consuming instruction instead of discarding that instruction. Keep unannotated-global behavior unchanged, preserve function and closure ignores, and distinguish writes to a global from stores of its address. Resolve generic instantiations to their original declarations before classifying atomic operations. This recognizes atomic.Pointer methods without bypassing package or mixed-access checks for generic calls. Assisted-by: Codex
Use atomic.Pointer for the waiter's bucket pointer and require atomic accesses. The generated wrapper only delegates to the same pointer operations, but hides them behind a package the checker does not classify as atomic. Waiters are not serialized, so its generated state hooks are unnecessary. Declare the PI lock and unlock helpers' existing bucket requirements. Preserve the ordered lock handles and explain why logical bucket aliases and moving waiter membership cannot carry uniform mutex annotations. Document that a queued waiter cannot be reused until WaitComplete returns. Keep the lock-and-revalidate protocol, atomic nil publication after notification and reverse-order bucket release. Assisted-by: Codex
tamird
force-pushed
the
checklocks-futex-pi
branch
from
August 22, 2026 16:19
0408003 to
583330f
Compare
Contributor
Author
|
Closing in favor of consolidated #14345. The expanded replacement commits are prepared locally; the replacement branch has not been pushed yet. Assisted-by: Codex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PI lock and unlock helpers operate on a bucket acquired by their callers. Declare those entry requirements without changing lock scope.
Correct the ordered bucket return contract: the first handle is always non-nil, and the second is nil only when both keys select the same bucket. Retain prose for these conditional aliases that checklocks cannot express.
Include PI waits in waiter lifecycle documentation and state the membership and lock requirements for wake and requeue helpers. Preserve the lock-and-revalidate protocol and reverse-order release.
Assisted-by: Codex