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


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

Bug#976616: Abysmally slow writes to crypted partition

From Matthew Wilcox <willy@infradead.org>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.boot
Subject Bug#976616: Abysmally slow writes to crypted partition
Date 2020-12-05 22:00 +0100
Message-ID <BiMOR-Wh-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


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.

Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web