Commit 9f2772c4 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent bff796ae
......@@ -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",
......
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