aboutsummaryrefslogtreecommitdiffstats
path: root/lib/raid6/algos.c
diff options
context:
space:
mode:
authorDaniel Verkamp <[email protected]>2018-11-12 23:26:52 +0000
committerShaohua Li <[email protected]>2018-12-20 16:53:23 +0000
commitbe85f93ae2df32dea0b20908316f1d894c3e0f64 (patch)
tree83da6e27e6ab8e949115a5a690af009c69912da3 /lib/raid6/algos.c
parentlib/raid6: sort algos in rough performance order (diff)
downloadkernel-be85f93ae2df32dea0b20908316f1d894c3e0f64.tar.gz
kernel-be85f93ae2df32dea0b20908316f1d894c3e0f64.zip
lib/raid6: add option to skip algo benchmarking
This is helpful for systems where fast startup time is important. It is especially nice to avoid benchmarking RAID functions that are never used (for example, BTRFS selects RAID6_PQ even if the parity RAID mode is not in use). This saves 250+ milliseconds of boot time on modern x86 and ARM systems with a dozen or more available implementations. The new option is defaulted to 'y' to match the previous behavior of always benchmarking on init. Signed-off-by: Daniel Verkamp <[email protected]> Signed-off-by: Shaohua Li <[email protected]>
Diffstat (limited to 'lib/raid6/algos.c')
-rw-r--r--lib/raid6/algos.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index a753ff56670f..7e4f7a8ffa8e 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -163,6 +163,11 @@ static inline const struct raid6_calls *raid6_choose_gen(
if ((*algo)->valid && !(*algo)->valid())
continue;
+ if (!IS_ENABLED(CONFIG_RAID6_PQ_BENCHMARK)) {
+ best = *algo;
+ break;
+ }
+
perf = 0;
preempt_disable();