From 0b1a428a1e2746701eff15e7680f815abeb38a95 Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Tue, 19 Jan 2016 16:33:27 -0800 Subject: [PATCH] dm-crypt: run in a WQ_HIGHPRI workqueue Running dm-crypt in a standard workqueue results in IO competing for CPU time with standard user apps, which can lead to pipeline bubbles and seriously degraded performance. Move to a WQ_HIGHPRI workqueue to protect against that. bug 25392275 Change-Id: I589149a31c7b5d322fe2ed5b2476b1f6e3d5ee6f --- drivers/md/dm-crypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 5972b0662b7a..59c8dbe0b975 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1639,6 +1639,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) ret = -ENOMEM; cc->io_queue = alloc_workqueue("kcryptd_io", + WQ_HIGHPRI | WQ_NON_REENTRANT| WQ_MEM_RECLAIM, 1); @@ -1648,7 +1649,8 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) } cc->crypt_queue = alloc_workqueue("kcryptd", - WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | + WQ_HIGHPRI | + WQ_MEM_RECLAIM | WQ_UNBOUND, num_online_cpus()); if (!cc->crypt_queue) { ti->error = "Couldn't create kcryptd queue";