Skip to content

Commit

Permalink
ZEN: dm-crypt: Disable workqueues for crypto ops
Browse files Browse the repository at this point in the history
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.

Fixes: zen-kernel/zen-kernel#282
Signed-off-by: Alexandre Frade <[email protected]>
  • Loading branch information
damentz authored and xanmod committed Sep 16, 2024
1 parent 70796a7 commit aa588c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3310,6 +3310,9 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad;
}

set_bit(DM_CRYPT_NO_READ_WORKQUEUE, &cc->flags);
set_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags);

ret = crypt_ctr_cipher(ti, argv[0], argv[1]);
if (ret < 0)
goto bad;
Expand Down

0 comments on commit aa588c4

Please sign in to comment.