diff options
author | Nicholas Swenson <nks@daterainc.com> | 2014-01-09 19:03:04 -0500 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-03-18 15:22:33 -0400 |
commit | da415a096fc06e49d1a15f7a06bcfe6ad44c5d38 (patch) | |
tree | 54a5b937d4acd579f43b9dc062afd41ecaa33d82 /drivers/md/bcache/request.h | |
parent | 90db6919f5f1614d1b7a92052445506bc6c564d2 (diff) |
bcache: Fix moving_gc deadlocking with a foreground write
Deadlock happened because a foreground write slept, waiting for a bucket
to be allocated. Normally the gc would mark buckets available for invalidation.
But the moving_gc was stuck waiting for outstanding writes to complete.
These writes used the bcache_wq, the same queue foreground writes used.
This fix gives moving_gc its own work queue, so it was still finish moving
even if foreground writes are stuck waiting for allocation. It also makes
work queue a parameter to the data_insert path, so moving_gc can use its
workqueue for writes.
Signed-off-by: Nicholas Swenson <nks@daterainc.com>
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/request.h')
-rw-r--r-- | drivers/md/bcache/request.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/bcache/request.h b/drivers/md/bcache/request.h index 39f21dbedc38..c117c4082aa2 100644 --- a/drivers/md/bcache/request.h +++ b/drivers/md/bcache/request.h | |||
@@ -7,6 +7,7 @@ struct data_insert_op { | |||
7 | struct closure cl; | 7 | struct closure cl; |
8 | struct cache_set *c; | 8 | struct cache_set *c; |
9 | struct bio *bio; | 9 | struct bio *bio; |
10 | struct workqueue_struct *wq; | ||
10 | 11 | ||
11 | unsigned inode; | 12 | unsigned inode; |
12 | uint16_t write_point; | 13 | uint16_t write_point; |