Skip to content

Commit 808695d

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 <[email protected]>
1 parent 1c5ddc5 commit 808695d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/md/dm-crypt.c

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

3318+
#ifdef CONFIG_ZEN_INTERACTIVE
3319+
set_bit(DM_CRYPT_NO_READ_WORKQUEUE, &cc->flags);
3320+
set_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags);
3321+
#endif
3322+
33183323
ret = crypt_ctr_cipher(ti, argv[0], argv[1]);
33193324
if (ret < 0)
33203325
goto bad;

init/Kconfig

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

156156
Default scheduler for SQ..: mq-deadline -> bfq
157157
Default scheduler for MQ..: none -> kyber
158+
DM-Crypt workqueues.......: yes -> no
158159

159160
--- Virtual Memory Subsystem ---------------------------
160161

0 commit comments

Comments
 (0)