]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: Fix moving_gc deadlocking with a foreground write
authorNicholas Swenson <nks@daterainc.com>
Fri, 10 Jan 2014 00:03:04 +0000 (16:03 -0800)
committerKent Overstreet <kmo@daterainc.com>
Tue, 18 Mar 2014 19:22:33 +0000 (12:22 -0700)
commit120edb27550652a8132c1e27933cc1407d4fc5e5
tree54a5b937d4acd579f43b9dc062afd41ecaa33d82
parenta9e176ed2fb9956b85493a666d6b0bbc0420f1e6
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>
drivers/md/bcache/bcache.h
drivers/md/bcache/movinggc.c
drivers/md/bcache/request.c
drivers/md/bcache/request.h
drivers/md/bcache/super.c