mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-23 02:51:47 +00:00
bcachefs: Split out btree_error_wq
We can't use btree_update_wq becuase btree updates may be waiting on btree writes to complete. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
bff796ae65
commit
9f2772c454
3 changed files with 6 additions and 1 deletions
|
@ -667,6 +667,7 @@ struct bch_fs {
|
|||
struct btree_key_cache btree_key_cache;
|
||||
|
||||
struct workqueue_struct *btree_update_wq;
|
||||
struct workqueue_struct *btree_error_wq;
|
||||
/* copygc needs its own workqueue for index updates.. */
|
||||
struct workqueue_struct *copygc_wq;
|
||||
|
||||
|
|
|
@ -1618,7 +1618,7 @@ static void btree_node_write_work(struct work_struct *work)
|
|||
bio_list_add(&c->btree_write_error_list, &wbio->wbio.bio);
|
||||
spin_unlock_irqrestore(&c->btree_write_error_lock, flags);
|
||||
|
||||
queue_work(c->btree_update_wq, &c->btree_write_error_work);
|
||||
queue_work(c->btree_error_wq, &c->btree_write_error_work);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -514,6 +514,8 @@ static void __bch2_fs_free(struct bch_fs *c)
|
|||
destroy_workqueue(c->io_complete_wq );
|
||||
if (c->copygc_wq)
|
||||
destroy_workqueue(c->copygc_wq);
|
||||
if (c->btree_error_wq)
|
||||
destroy_workqueue(c->btree_error_wq);
|
||||
if (c->btree_update_wq)
|
||||
destroy_workqueue(c->btree_update_wq);
|
||||
|
||||
|
@ -766,6 +768,8 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
|
|||
|
||||
if (!(c->btree_update_wq = alloc_workqueue("bcachefs",
|
||||
WQ_FREEZABLE|WQ_MEM_RECLAIM, 1)) ||
|
||||
!(c->btree_error_wq = alloc_workqueue("bcachefs_error",
|
||||
WQ_FREEZABLE|WQ_MEM_RECLAIM, 1)) ||
|
||||
!(c->copygc_wq = alloc_workqueue("bcachefs_copygc",
|
||||
WQ_FREEZABLE|WQ_MEM_RECLAIM|WQ_CPU_INTENSIVE, 1)) ||
|
||||
!(c->io_complete_wq = alloc_workqueue("bcachefs_io",
|
||||
|
|
Loading…
Reference in a new issue