Commit f2bfe7e8 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Rip out freelists from btree key cache

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent d2ed0f20
This diff is collapsed.
...@@ -2,33 +2,19 @@ ...@@ -2,33 +2,19 @@
#ifndef _BCACHEFS_BTREE_KEY_CACHE_TYPES_H #ifndef _BCACHEFS_BTREE_KEY_CACHE_TYPES_H
#define _BCACHEFS_BTREE_KEY_CACHE_TYPES_H #define _BCACHEFS_BTREE_KEY_CACHE_TYPES_H
struct btree_key_cache_freelist {
struct bkey_cached *objs[16];
unsigned nr;
};
struct btree_key_cache { struct btree_key_cache {
struct mutex lock;
struct rhashtable table; struct rhashtable table;
bool table_init_done; bool table_init_done;
struct list_head freed_pcpu;
size_t nr_freed_pcpu;
struct list_head freed_nonpcpu;
size_t nr_freed_nonpcpu;
struct shrinker *shrink; struct shrinker *shrink;
unsigned shrink_iter; unsigned shrink_iter;
struct btree_key_cache_freelist __percpu *pcpu_freed;
atomic_long_t nr_freed;
atomic_long_t nr_keys; atomic_long_t nr_keys;
atomic_long_t nr_dirty; atomic_long_t nr_dirty;
/* shrinker stats */ /* shrinker stats */
unsigned long requested_to_free; unsigned long requested_to_free;
unsigned long freed; unsigned long freed;
unsigned long moved_to_freelist;
unsigned long skipped_dirty; unsigned long skipped_dirty;
unsigned long skipped_accessed; unsigned long skipped_accessed;
unsigned long skipped_lock_fail; unsigned long skipped_lock_fail;
......
...@@ -386,17 +386,17 @@ struct bkey_cached { ...@@ -386,17 +386,17 @@ struct bkey_cached {
struct btree_bkey_cached_common c; struct btree_bkey_cached_common c;
unsigned long flags; unsigned long flags;
unsigned long btree_trans_barrier_seq;
u16 u64s; u16 u64s;
struct bkey_cached_key key; struct bkey_cached_key key;
struct rhash_head hash; struct rhash_head hash;
struct list_head list;
struct journal_entry_pin journal; struct journal_entry_pin journal;
u64 seq; u64 seq;
struct bkey_i *k; struct bkey_i *k;
struct rcu_head rcu;
}; };
static inline struct bpos btree_node_pos(struct btree_bkey_cached_common *b) static inline struct bpos btree_node_pos(struct btree_bkey_cached_common *b)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment