Repository navigation
Annotate lockless reads in homa_qdisc_deferred_offset - #148
Open
randomizedcoder wants to merge 1 commit into
Open
randomizedcoder wants to merge 1 commit into
randomizedcoder wants to merge 1 commit into
Conversation
homa_qdisc_deferred_offset reads the length of an RPC's deferred packet queue and its tx_left without holding qdev->defer_lock, while the pacer modifies both under that lock. The race is intentional, but the reads were plain loads, which KCSAN reports as a data race. Use skb_queue_len_lockless and READ_ONCE/WRITE_ONCE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder
added a commit
to randomizedcoder/HomaModule
that referenced
this pull request
Oct 31, 2026
…rmLab#148) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
homa_qdisc_deferred_offset()reads a deferred RPC's packet queue length andqrpc.tx_leftwithoutqdev->defer_lock, while the pacer changes both under that lock. The comment says the race is intended (a slightly stale result is fine), but the reads are plain loads, so KCSAN reports it:Fix: annotate the intended race.
skb_queue_len_lockless()for the length (__skb_unlinkalready writesqlenwithWRITE_ONCE).READ_ONCE(rpc->qrpc.tx_left)there, andWRITE_ONCEat the two stores inhoma_qdisc.c.defer_lockstay plain.No behaviour change.
Checked:
__STRIP__=1.No test, since it's an annotation only.
🤖 Generated with Claude Code