Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1035998 > unrolled thread

Bug#976616: Abysmally slow writes to crypted partition

Started byMatthew Wilcox <willy@infradead.org>
First post2020-12-05 22:00 +0100
Last post2020-12-05 22:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#976616: Abysmally slow writes to crypted partition Matthew Wilcox <willy@infradead.org> - 2020-12-05 22:00 +0100

#1035998 — Bug#976616: Abysmally slow writes to crypted partition

FromMatthew Wilcox <willy@infradead.org>
Date2020-12-05 22:00 +0100
SubjectBug#976616: Abysmally slow writes to crypted partition
Message-ID<BiMOR-Wh-3@gated-at.bofh.it>
Package: partman-crypto

This isn't really a bug in partman-crypto, but I'm reporting it here
for tracking purposes as requested by Steve McIntyre.

The symptom I first experienced was when doing an install on a Tiger
Lake laptop with a 1TB SSD.  The step where we run blockdev-wipe was
going to take over 20 hours.

I am currently investigating *why* it's taking so long.  The SSD is
capable of writing at 1.2GB/s and the CPU is capable of encrypting at
>4GB/s, so the measured 13.7MB/s is ridiculous.

What I've discovered so far is that writing through the page cache
is (part of) the problem:

# dd if=/dev/zero bs=64k count=1000 of=/dev/mapper/nvme0n1p4_crypt
4.79s, 13.7MB/s

# dd if=/dev/zero bs=64k count=100000 of=/dev/mapper/nvme0n1p4_crypt oflag=direct
13.6s, 481MB/s

If you need to get a release out that doesn't crater performance before I
find & fix this bug in the kernel, you could change blockdev-wipe.c to use
O_DIRECT.  That would be a matter of changing the calloc() call on line
86 to posix_memalign() (and an optional memset()) and specifying O_DIRECT
on line 161.  You need to align to at least 512 bytes, and for safety,
I'd align to sysconf(_SC_PAGESIZE).  I have not tested this workaround.

[toc] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web