Btrfs: Add a thread pool just for submit_bio
If a bio submission is after a lock holder waiting for the bio
on the work queue, it is possible to deadlock. Move the bios
into their own pool.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 181c81d..dcea9d7 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -529,9 +529,13 @@
* can run with FS locks held, and the writers may be waiting for
* those locks. We don't want ordering in the pending list to cause
* deadlocks, and so the two are serviced separately.
+ *
+ * A third pool does submit_bio to avoid deadlocking with the other
+ * two
*/
struct btrfs_workers workers;
struct btrfs_workers endio_workers;
+ struct btrfs_workers submit_workers;
int thread_pool_size;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)