summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-region-hash.c
diff options
context:
space:
mode:
authorIgnat Korchagin <ignat@cloudflare.com>2020-07-06 18:37:31 +0100
committerMike Snitzer <snitzer@redhat.com>2020-07-20 11:17:44 -0400
commit39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877 (patch)
tree80ba6aaf80e7a0913c23919aa1dcb0ded6665960 /drivers/md/dm-region-hash.c
parent70704c33db841d847b16d8ae7e29ae3b8a479e75 (diff)
downloadlinux-stable-39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877.tar.gz
linux-stable-39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877.tar.bz2
linux-stable-39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877.zip
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated with dm-crypt's use of workqueues when processing IO. Current dm-crypt implementation creates a significant IO performance overhead (at least on small IO block sizes) for both latency and throughput. We suspect offloading IO request processing into workqueues and async threads is more harmful these days with the modern fast storage. I also did some digging into the dm-crypt git history and much of this async processing is not needed anymore, because the reasons it was added are mostly gone from the kernel. More details can be found in [2] (see "Git archeology" section). This change adds DM_CRYPT_NO_READ_WORKQUEUE and DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which direct dm-crypt to not offload crypto operations into kcryptd workqueues. In addition, writes are not buffered to be sorted in the dm-crypt red-black tree, but dispatched immediately. For cases, where crypto operations cannot happen (hard interrupt context, for example the read path of some NVME drivers), we offload the work to a tasklet rather than a workqueue. These flags only ensure no async BIO processing in the dm-crypt module. It is worth noting that some Crypto API implementations may offload encryption into their own workqueues, which are independent of the dm-crypt and its configuration. However upon enabling these new flags dm-crypt will instruct Crypto API not to backlog crypto requests. To give an idea of the performance gains for certain workloads, consider the script, and results when tested against various devices, detailed here: https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html [1]: https://www.spinics.net/lists/dm-crypt/msg07516.html [2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/ Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Bob Liu <bob.liu@oracle.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-region-hash.c')
0 files changed, 0 insertions, 0 deletions