mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 03:26:26 +00:00
bcachefs: Mark newly allocated btree nodes as accessed
This was a major oversight - this means under memory pressure we can end up reading in a btree node, then having it evicted before we get to use it. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
595c1e9bab
commit
e68031fb46
1 changed files with 1 additions and 0 deletions
|
@ -590,6 +590,7 @@ struct btree *bch2_btree_node_mem_alloc(struct bch_fs *c)
|
||||||
b->sib_u64s[1] = 0;
|
b->sib_u64s[1] = 0;
|
||||||
b->whiteout_u64s = 0;
|
b->whiteout_u64s = 0;
|
||||||
bch2_btree_keys_init(b);
|
bch2_btree_keys_init(b);
|
||||||
|
set_btree_node_accessed(b);
|
||||||
|
|
||||||
bch2_time_stats_update(&c->times[BCH_TIME_btree_node_mem_alloc],
|
bch2_time_stats_update(&c->times[BCH_TIME_btree_node_mem_alloc],
|
||||||
start_time);
|
start_time);
|
||||||
|
|
Loading…
Reference in a new issue