md: dm-crypt: Add option to re-use a new global work-queue.
Typically, dm-crypt instances each have their own set of kcrypt/kcrypt_io
work-queues. This patch adds an option which will create one set of
work-queues on init, and re-uses them for all dm-crypt target instances.
Cc: Milan Broz <mbroz@redhat.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christophe Saout <christophe@saout.de>
Signed-off-by: San Mehat <san@google.com>
---
drivers/md/Kconfig | 10 ++++++++++
drivers/md/dm-crypt.c | 42 +++++++++++++++++++++++++++++++++++++++---
2 files changed, 49 insertions(+), 3 deletions(-)
+config DM_CRYPT_GLOBAL_WORKQUEUES
+ boolean "Use global instead of per-device work-queues"
+ depends on DM_CRYPT
+ ---help---
+ Normally 2 kernel work-queue threads are created for every
+ dm-crypt target. This option creates only 1 set of work-queues
+ on init, and re-uses them.
+
+ If unsure, say N.
+
config DM_SNAPSHOT
tristate "Snapshot target"
depends on BLK_DEV_DM
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 959d6d1..875ad9a 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -104,8 +104,10 @@ struct crypt_config {
mempool_t *page_pool;
struct bio_set *bs;