diff options
author | Daniel Hill <daniel@gluo.nz> | 2022-10-06 15:53:36 +1300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:44 -0400 |
commit | b5ac23c465c4ef8e94f6f2c9f2333193dccf9fc3 (patch) | |
tree | a7da2acca26f1b9ed1248ae4daede7a7556d5ec6 /fs/bcachefs/btree_cache.c | |
parent | bd954215cad1dbe4304736e6968d8a0c10d1e048 (diff) | |
download | lwn-b5ac23c465c4ef8e94f6f2c9f2333193dccf9fc3.tar.gz lwn-b5ac23c465c4ef8e94f6f2c9f2333193dccf9fc3.zip |
bcachefs: improve behaviour of btree_cache_scan()
Appending new nodes to the end of the list means we're more likely to
evict old entries when btree_cache_scan() is started.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_cache.c')
-rw-r--r-- | fs/bcachefs/btree_cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c index db786df19318..75bc18466e75 100644 --- a/fs/bcachefs/btree_cache.c +++ b/fs/bcachefs/btree_cache.c @@ -173,7 +173,7 @@ int bch2_btree_node_hash_insert(struct btree_cache *bc, struct btree *b, mutex_lock(&bc->lock); ret = __bch2_btree_node_hash_insert(bc, b); if (!ret) - list_add(&b->list, &bc->live); + list_add_tail(&b->list, &bc->live); mutex_unlock(&bc->lock); return ret; |