Christoph Hellwig
10dab13117
raid6/kunit: add a benchmark
...
Add a benchmark to test the RAID 6 P/Q functions for more representative
block sizes and numbers of disks. This splits the maximum alloc size used
for the benchmark from the max size for the kunit test because recovery is
currently limited to a single page at a time. Hopefully this will be
fixed soon.
The runtime numbers are reported in GB/s as the numbers of modern
implementations are basically unreadable as MB/s. This means
retro-architectures could report 0, but that is an easy tradeoff.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Cc: Eric Biggers <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-08-03 21:10:16 -07:00
Christoph Hellwig
8cf0a6c4bb
raid6_kunit: randomize buffer alignment
...
Add code to add random alignment to the buffers to test the case where
they are not page aligned, and to move the buffers to the end of the
allocation so that they are next to the vmalloc guard page.
This does not include the recovery buffers as the recovery requires page
alignment.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:56 -07:00
Christoph Hellwig
fa0c812c0a
raid6_kunit: randomize parameters and increase limits
...
The current test has double-quadratic behavior in the selection for the
updated ("XORed") disks, and in the selection of updated pointers, which
makes scaling it to more tests difficult. At the same time it only ever
tests with the maximum number of disks, which leaves a coverage hole for
smaller ones.
Fix this by randomizing the total number, failed disks and regions to
update, and increasing the upper number of tests disks.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:56 -07:00
Christoph Hellwig
562bcbfcb9
raid6_kunit: cleanup dataptr handling
...
Move the global dataptr array into test_recover() as all sites that fill
data or parity can use test_buffers directly, and this localized the
override for the failed slots to the recovery testing routine.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:56 -07:00
Christoph Hellwig
d67c25712f
raid6_kunit: dynamically allocate data buffers using vmalloc
...
Use vmalloc for the data buffers instead of using static .data
allocations. This provides for better out of bounds checking and avoids
wasting kernel memory after the test has run. vmalloc is used instead of
kmalloc to provide for better out of bounds access checking as in other
kunit tests.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:56 -07:00
Christoph Hellwig
2175395f76
raid6_kunit: use KUNIT_CASE_PARAM
...
The raid6 test combines various generation and recovery algorithms. Use
KUNIT_CASE_PARAM and provide a generator that iterates over the possible
combinations instead of looping inside a single test instance.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:55 -07:00
Christoph Hellwig
adfcf6e89b
raid6: rework registration of optimized algorithms
...
Replace the static array of algorithms with a call to an architecture
helper to register algorithms. This serves two purposes: it avoid having
to register all algorithms in a single central place, and it removes the
need for the priority field by just registering the algorithms that the
architecture considers suitable for the currently running CPUs.
[[email protected] : register avx512 after avx2]
Link: https://lore.kernel.org/[email protected]
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:54 -07:00
Christoph Hellwig
769d603fc4
raid6: hide internals
...
Split out two new headers from the public pq.h:
- lib/raid/raid6/algos.h contains the algorithm lists private to
lib/raid/raid6
- include/linux/raid/pq_tables.h contains the tables also used by
async_tx providers.
The public include/linux/pq.h is now limited to the public interface for
the consumers of the RAID6 PQ API.
[[email protected] : remove duplicate ccflags-y line]
Link: https://lore.kernel.org/[email protected]
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:54 -07:00
Christoph Hellwig
3626738bc7
raid6: move to lib/raid/
...
Move the raid6 code to live in lib/raid/ with the XOR code, and change the
internal organization so that each architecture has a subdirectory similar
to the CRC, crypto and XOR libraries, and fix up the Makefile to only
build files actually needed.
Also move the kunit test case from the history test/ subdirectory to
tests/ and use the normal naming scheme for it.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christoph Hellwig <[email protected] >
Acked-by: Ard Biesheuvel <[email protected] >
Tested-by: Ard Biesheuvel <[email protected] > # kunit only on arm64
Cc: Albert Ou <[email protected] >
Cc: Alexander Gordeev <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: "Borislav Petkov (AMD)" <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Chris Mason <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Dan Williams <[email protected] >
Cc: David Sterba <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: Herbert Xu <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Li Nan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2026-05-28 21:24:53 -07:00