[PW_SID:1096320] [01/18] raid6: turn the userspace test harness into a kunit test#1959
[PW_SID:1096320] [01/18] raid6: turn the userspace test harness into a kunit test#1959linux-riscv-bot wants to merge 19 commits into
Conversation
Currently the raid6 code can be compiled as userspace code to run the test suite. Convert that to be a kunit case with minimal changes to avoid mutating global state so that we can drop this requirement. Note that this is not a good kunit test case yet and will need a lot more work, but that is deferred until the raid6 code is moved to it's new place, which is easier if the userspace makefile doesn't need adjustments for the new location first. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
With the test code ported to kernel space, none of this is required. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These are not used anywhere in the kernel. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Just open code it as in other places in the kernel. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Stop directly calling into function pointers from users of the RAID6 PQ API, and provide exported functions with proper documentation and API guarantees asserts where applicable instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Quoting H. Peter Anvin who came up with the RAID6 P/Q algorithm, and who wrote the initial implementation, then still part of the md driver: The RAID-6 code has *never* supported only 3 units, and if it ever worked for *any* of the implementations it was purely by accident. Speaking as the original author I should know; this was deliberate as in some cases the degenerate case (3) would have required extra trays in the code to no user benefit. While md never allowed less than 4 devices, btrfs does. This new warning will trigger for such file systems, but given how it already causes havoc that is a good thing. If btrfs wants to fix third, it should switch to transparently use three-way mirroring underneath, which will work as P and Q are copies of the single data device by the definition of the Linux RAID 6 P/Q algorithm. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Avoid indirect calls for P/Q parity generation. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Avoid expensive indirect calls for the recovery routines as well. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Drop the pointless mention of the file name, and use standard formatting for the top of file comments. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 1: "[01/18] raid6: turn the userspace test harness into a kunit test" |
|
Patch 16: "[16/18] raid6_kunit: cleanup dataptr handling" |
|
Patch 16: "[16/18] raid6_kunit: cleanup dataptr handling" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 17: "[17/18] raid6_kunit: randomize parameters and increase limits" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
|
Patch 18: "[18/18] raid6_kunit: randomize buffer alignment" |
a1231b7 to
c03cdce
Compare
PR for series 1096320 applied to workflow__riscv__fixes
Name: [01/18] raid6: turn the userspace test harness into a kunit test
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1096320
Version: 1