diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-12-19 11:29:03 -0800 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-01-04 20:35:32 +0100 |
| commit | b140a921eadfeaf48238a3a6d2da2a5e6946a31b (patch) | |
| tree | 5ce590d896d5d75bbbb50d401b7d7f2607255e98 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | a23cc8257ecdfdeb25fd26d25fec4539ef377944 (diff) | |
dm-verity: move dm_verity_fec_io to mempool
Currently, struct dm_verity_fec_io is allocated in the front padding of
struct bio using dm_target::per_io_data_size. Unfortunately, struct
dm_verity_fec_io is very large: 3096 bytes when CONFIG_64BIT=y &&
PAGE_SIZE == 4096, or 9240 bytes when CONFIG_64BIT=y && PAGE_SIZE ==
16384. This makes the bio size very large.
Moreover, most of dm_verity_fec_io gets iterated over up to three times,
even on I/O requests that don't require any error correction:
1. To zero the memory on allocation, if init_on_alloc=1. (This happens
when the bio is allocated, not in dm-verity itself.)
2. To zero the buffers array in verity_fec_init_io().
3. To free the buffers in verity_fec_finish_io().
Fix all of these inefficiencies by moving dm_verity_fec_io to a mempool.
Replace the embedded dm_verity_fec_io with a pointer
dm_verity_io::fec_io. verity_fec_init_io() initializes it to NULL,
verity_fec_decode() allocates it on the first call, and
verity_fec_finish_io() cleans it up. The normal case is that the
pointer simply stays NULL, so the overhead becomes negligible.
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
