diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-30 12:30:52 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-04 14:17:11 -0400 |
| commit | c4accde498dd7db8352d574958d19a5f710aba69 (patch) | |
| tree | 7dc805652f5bcf02f1772dc8b44dfa210a92c0ee /fs/bcachefs/btree_types.h | |
| parent | 6dfa10ab22a6a322269a3454d7ac720dc2f8bf11 (diff) | |
| download | linux-c4accde498dd7db8352d574958d19a5f710aba69.tar.gz linux-c4accde498dd7db8352d574958d19a5f710aba69.tar.bz2 linux-c4accde498dd7db8352d574958d19a5f710aba69.zip | |
bcachefs: Ensure srcu lock is not held too long
The SRCU read lock that btree_trans takes exists to make it safe for
bch2_trans_relock() to deref pointers to btree nodes/key cache items we
don't have locked, but as a side effect it blocks reclaim from freeing
those items.
Thus, it's important to not hold it for too long: we need to
differentiate between bch2_trans_unlock() calls that will be only for a
short duration, and ones that will be for an unbounded duration.
This introduces bch2_trans_unlock_long(), to be used mainly by the data
move paths.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
| -rw-r--r-- | fs/bcachefs/btree_types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h index ecbb44b939a0..7cc8d6b12161 100644 --- a/fs/bcachefs/btree_types.h +++ b/fs/bcachefs/btree_types.h @@ -426,6 +426,7 @@ struct btree_trans { u8 nr_updates; u8 nr_wb_updates; u8 wb_updates_size; + bool srcu_held:1; bool used_mempool:1; bool in_traverse_all:1; bool paths_sorted:1; |
