diff options
| author | Tim Murray <timmurray@google.com> | 2016-01-19 16:33:27 -0800 |
|---|---|---|
| committer | Mark Salyzyn <salyzyn@google.com> | 2016-03-08 20:42:29 +0000 |
| commit | 46050a93ff9e13fddcdcaff35e2b0b863b3af69b (patch) | |
| tree | 8d379b14e3b33bc343bae1907e0ea0f9be178ac3 | |
| parent | 8d3a6c1538fb021448c4f6381f6191061f947ba1 (diff) | |
ANDROID: dm-crypt: run in a WQ_HIGHPRI workqueue
(cherry pick from commit ad3ac5180979e5dd1f84e4a807f76fb9fb19f814)
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
Change-Id: I589149a31c7b5d322fe2ed5b2476b1f6e3d5ee6f
| -rw-r--r-- | drivers/md/dm-crypt.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3147c8d09ea8..855600410064 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1864,16 +1864,25 @@ 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_NON_REENTRANT| + 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"; |
