Commit 56b30770b27d54d68ad51eccc6d888282b568cee
1 parent
2a285686c1
Exists in
master
and in
13 other branches
bcache: Kill btree_io_wq
With the locking rework in the last patch, this shouldn't be needed anymore - btree_node_write_work() only takes b->write_lock which is never held for very long. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Showing 3 changed files with 2 additions and 24 deletions Side-by-side Diff
drivers/md/bcache/bcache.h
drivers/md/bcache/btree.c
... | ... | @@ -93,8 +93,6 @@ |
93 | 93 | #define PTR_HASH(c, k) \ |
94 | 94 | (((k)->ptr[0] >> c->bucket_bits) | PTR_GEN(k, 0)) |
95 | 95 | |
96 | -static struct workqueue_struct *btree_io_wq; | |
97 | - | |
98 | 96 | #define insert_lock(s, b) ((b)->level <= (s)->lock) |
99 | 97 | |
100 | 98 | /* |
... | ... | @@ -362,8 +360,7 @@ |
362 | 360 | btree_complete_write(b, w); |
363 | 361 | |
364 | 362 | if (btree_node_dirty(b)) |
365 | - queue_delayed_work(btree_io_wq, &b->work, | |
366 | - msecs_to_jiffies(30000)); | |
363 | + schedule_delayed_work(&b->work, 30 * HZ); | |
367 | 364 | |
368 | 365 | closure_return_with_destructor(cl, btree_node_write_unlock); |
369 | 366 | } |
... | ... | @@ -535,7 +532,7 @@ |
535 | 532 | BUG_ON(!i->keys); |
536 | 533 | |
537 | 534 | if (!btree_node_dirty(b)) |
538 | - queue_delayed_work(btree_io_wq, &b->work, 30 * HZ); | |
535 | + schedule_delayed_work(&b->work, 30 * HZ); | |
539 | 536 | |
540 | 537 | set_btree_node_dirty(b); |
541 | 538 | |
... | ... | @@ -2445,20 +2442,5 @@ |
2445 | 2442 | |
2446 | 2443 | spin_lock_init(&buf->lock); |
2447 | 2444 | array_allocator_init(&buf->freelist); |
2448 | -} | |
2449 | - | |
2450 | -void bch_btree_exit(void) | |
2451 | -{ | |
2452 | - if (btree_io_wq) | |
2453 | - destroy_workqueue(btree_io_wq); | |
2454 | -} | |
2455 | - | |
2456 | -int __init bch_btree_init(void) | |
2457 | -{ | |
2458 | - btree_io_wq = create_singlethread_workqueue("bch_btree_io"); | |
2459 | - if (!btree_io_wq) | |
2460 | - return -ENOMEM; | |
2461 | - | |
2462 | - return 0; | |
2463 | 2445 | } |
drivers/md/bcache/super.c
... | ... | @@ -2072,7 +2072,6 @@ |
2072 | 2072 | { |
2073 | 2073 | bch_debug_exit(); |
2074 | 2074 | bch_request_exit(); |
2075 | - bch_btree_exit(); | |
2076 | 2075 | if (bcache_kobj) |
2077 | 2076 | kobject_put(bcache_kobj); |
2078 | 2077 | if (bcache_wq) |
... | ... | @@ -2102,7 +2101,6 @@ |
2102 | 2101 | if (!(bcache_wq = create_workqueue("bcache")) || |
2103 | 2102 | !(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) || |
2104 | 2103 | sysfs_create_files(bcache_kobj, files) || |
2105 | - bch_btree_init() || | |
2106 | 2104 | bch_request_init() || |
2107 | 2105 | bch_debug_init(bcache_kobj)) |
2108 | 2106 | goto err; |