bcachefs: Add some cond_rescheds() in shutdown path
Particularly on emergency shutdown we can end up having to clean up a lot of dirty cached btree keys here. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
537c49d6af
commit
1d8305c11a
@ -581,6 +581,8 @@ void bch2_fs_btree_key_cache_exit(struct btree_key_cache *bc)
|
||||
list_splice(&bc->dirty, &bc->clean);
|
||||
|
||||
list_for_each_entry_safe(ck, n, &bc->clean, list) {
|
||||
cond_resched();
|
||||
|
||||
bch2_journal_pin_drop(&c->journal, &ck->journal);
|
||||
bch2_journal_preres_put(&c->journal, &ck->res);
|
||||
|
||||
@ -594,6 +596,8 @@ void bch2_fs_btree_key_cache_exit(struct btree_key_cache *bc)
|
||||
BUG_ON(bc->nr_keys);
|
||||
|
||||
list_for_each_entry_safe(ck, n, &bc->freed, list) {
|
||||
cond_resched();
|
||||
|
||||
list_del(&ck->list);
|
||||
kmem_cache_free(bch2_key_cache, ck);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user