aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2016-01-19 16:33:27 -0800
committerMattias Nissler <mnissler@google.com>2016-07-20 16:18:27 +0200
commit49f813ca0f7f33748ccea729f1f1f42fa04b417b (patch)
treef00f2cf84da3e5f0e875b5725f8ea3b3bc6f6108
parent6ebf8ac5c853c8bb9356643ef4d98af1fab0269b (diff)
downloadv4.4-49f813ca0f7f33748ccea729f1f1f42fa04b417b.tar.gz
ANDROID: 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. Signed-off-by: Tim Murray <timmurray@google.com> Bug: 25392275 Patchset: dm-crypt-highpri-workqueue Signed-off-by: Mattias Nissler <mnissler@google.com> Change-Id: Ice4e98c32591f17b1400cfe12b82fa54e9ada1cf
-rw-r--r--drivers/md/dm-crypt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 3147c8d09ea8..e85bcae50f65 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1864,16 +1864,24 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}
ret = -ENOMEM;
- cc->io_queue = alloc_workqueue("kcryptd_io", WQ_MEM_RECLAIM, 1);
+ cc->io_queue = alloc_workqueue("kcryptd_io",
+ WQ_HIGHPRI |
+ WQ_MEM_RECLAIM,
+ 1);
if (!cc->io_queue) {
ti->error = "Couldn't create kcryptd io queue";
goto bad;
}
if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags))
- cc->crypt_queue = alloc_workqueue("kcryptd", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1);
+ cc->crypt_queue = alloc_workqueue("kcryptd",
+ WQ_HIGHPRI |
+ WQ_MEM_RECLAIM, 1);
else
- cc->crypt_queue = alloc_workqueue("kcryptd", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND,
+ cc->crypt_queue = alloc_workqueue("kcryptd",
+ WQ_HIGHPRI |
+ WQ_MEM_RECLAIM |
+ WQ_UNBOUND,
num_online_cpus());
if (!cc->crypt_queue) {
ti->error = "Couldn't create kcryptd queue";