bcachefs: use SRCU-aware waits after dropping locks#710
Closed
Komzpa wants to merge 1 commit into
Closed
Conversation
This was referenced Jun 29, 2026
bf9036c to
bd05064
Compare
Owner
|
Merged — cherry-picked onto master (e2097c2, authorship preserved, retitled |
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.
Summary
trans_wait_event()for the btree write throttling wait afterdrop_locks_do()trans_wait_event()for the journal-low-space wait before btree update reservationbch2_trans_unlock()fast path fromdrop_locks_do(), while letting long waits drop SRCU through the existing transaction-aware wait helperContext
This is a narrow follow-up to koverstreet/bcachefs#1069 and #659.
The earlier PR #659 handled the nocow-lock wait path. This patch covers the remaining direct
closure_wait_event()calls insidedrop_locks_do(trans, ...)scopes.drop_locks_do()already drops btree locks withbch2_trans_unlock(), but it does not drop the transaction SRCU read lock before the wrapped wait. Reusingtrans_wait_event()keeps short waits cheap and escalates only if the wait outlives the transaction short-wait budget.Validation
git diff --checkmake generate_version && BINDGEN=/home/kom/.cargo/bin/bindgen LIBCLANG_PATH=/usr/lib/llvm-18/lib CARGO_BUILD_JOBS=4 make -j4 bcachefsmake -C /lib/modules/$(uname -r)/build M=/home/kom/tmp/bcachefs-module-srcu-aware-wait-next modules -j4bd0506446be2b8186975c1edce51db30a20274cf