Skip to content

Commit 7681da0

Browse files
damentzkakra
authored andcommitted
ZEN: INTERACTIVE: dm-crypt: Disable workqueues for crypto ops
Queueing in dm-crypt for crypto operations reduces performance on modern systems. As discussed in an article from Cloudflare, they discovered that queuing was introduced because the crypto subsystem used to be synchronous. Since it's now asynchronous, we get double queueing when using the subsystem through dm-crypt. This is obviously undesirable and reduces throughput and increases latency. Disable queueing when using our Zen Interactive configuration. Fixes: zen-kernel#282 Signed-off-by: Kai Krakow <kai@kaishome.de>
1 parent afb3999 commit 7681da0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/md/dm-crypt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,6 +3308,11 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
33083308
goto bad;
33093309
}
33103310

3311+
#ifdef CONFIG_ZEN_INTERACTIVE
3312+
set_bit(DM_CRYPT_NO_READ_WORKQUEUE, &cc->flags);
3313+
set_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags);
3314+
#endif
3315+
33113316
ret = crypt_ctr_cipher(ti, argv[0], argv[1]);
33123317
if (ret < 0)
33133318
goto bad;

init/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ config ZEN_INTERACTIVE
172172

173173
Default scheduler for SQ..: mq-deadline -> bfq
174174
Default scheduler for MQ..: none -> kyber
175+
DM-Crypt workqueues.......: yes -> no
175176

176177
--- Virtual Memory Subsystem ---------------------------
177178

0 commit comments

Comments
 (0)