diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-09-04 05:07:31 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:40 +0300 |
commit | 3d21d48e898a2eadc9055c44e0fd51e6087c9e9f (patch) | |
tree | c52654bf87cab72d256887cd103142047cdf139e /fs/bcachefs/btree_types.h | |
parent | 0242130fb67fdcc617229fb9112c50f4caabab3c (diff) | |
download | linux-3d21d48e898a2eadc9055c44e0fd51e6087c9e9f.tar.xz |
bcachefs: Fix usage of six lock's percpu mode, key cache version
Similar to "bcachefs: Fix usage of six lock's percpu mode", six locks
have a percpu mode, but we can't switch between percpu and non percpu
modes while a lock is in use: threads attempting to take a read lock may
race, and we'll end up with the read count permanently off.
Fixing this the "correct" way, in six_lock_pcpu_(alloc|free) would
require an RCU barrier, and we don't want to do that - instead, we have
to permanently segragate percpu and non percpu objects, including when
on freelists.
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h index 6d9888e3a96a..0a3854b614e0 100644 --- a/fs/bcachefs/btree_types.h +++ b/fs/bcachefs/btree_types.h @@ -299,7 +299,8 @@ struct btree_key_cache { struct mutex lock; struct rhashtable table; bool table_init_done; - struct list_head freed; + struct list_head freed_pcpu; + struct list_head freed_nonpcpu; struct shrinker shrink; unsigned shrink_iter; struct btree_key_cache_freelist __percpu *pcpu_freed; |