From: Christoph Hellwig <hch@lst.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 6/8] raid6: defer implementation selection when built-in
Date: Wed, 15 Jul 2026 16:47:37 +0200 [thread overview]
Message-ID: <20260715144825.95432-7-hch@lst.de> (raw)
In-Reply-To: <20260715144825.95432-1-hch@lst.de>
Don't hold up early boot and defer the selection just like we've been
doing for the RAID5 XOR code since commit 524ccdbdfb52 ("crypto: xor -
defer load time benchmark to a later time").
This will also allow full use of the timing subsystem for benchmarking.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
lib/raid/raid6/algos.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/lib/raid/raid6/algos.c b/lib/raid/raid6/algos.c
index 6f5c89ab2b17..702e167a543a 100644
--- a/lib/raid/raid6/algos.c
+++ b/lib/raid/raid6/algos.c
@@ -239,10 +239,6 @@ static int __init raid6_select_algo(void)
if (!IS_ENABLED(CONFIG_RAID6_PQ_BENCHMARK) || raid6_nr_algos == 1) {
pr_info("raid6: skipped pq benchmark and selected %s\n",
raid6_algos[raid6_nr_algos - 1]->name);
- static_call_update(raid6_gen_syndrome_impl,
- raid6_algos[raid6_nr_algos - 1]->gen_syndrome);
- static_call_update(raid6_xor_syndrome_impl,
- raid6_algos[raid6_nr_algos - 1]->xor_syndrome);
return 0;
}
@@ -329,13 +325,34 @@ static int __init raid6_init(void)
static_call_update(raid6_recov_datap_impl, raid6_recov_algo->datap);
pr_info("raid6: using %s recovery algorithm\n", raid6_recov_algo->name);
+ /*
+ * Pick the last registered implementation as the temporary default until
+ * calibration happens.
+ */
+ static_call_update(raid6_gen_syndrome_impl,
+ raid6_algos[raid6_nr_algos - 1]->gen_syndrome);
+ static_call_update(raid6_xor_syndrome_impl,
+ raid6_algos[raid6_nr_algos - 1]->xor_syndrome);
+
+#ifdef MODULE
return raid6_select_algo();
+#else
+ return 0;
+#endif
}
static void __exit raid6_exit(void)
{
}
+/*
+ * When built-in we must register the default implementation before md
+ * initializes, but we don't want calibration to run that early as that
+ * would delay the boot process.
+ */
+#ifndef MODULE
+device_initcall(raid6_select_algo);
+#endif
subsys_initcall(raid6_init);
module_exit(raid6_exit);
MODULE_LICENSE("GPL");
--
2.53.0
next prev parent reply other threads:[~2026-07-15 14:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 14:47 misc lib/raid/ improvements v2 Christoph Hellwig
2026-07-15 14:47 ` [PATCH 1/8] xor: enable lock context analysis Christoph Hellwig
2026-07-15 14:47 ` [PATCH 2/8] xor: improve the runtime selection benchmark Christoph Hellwig
2026-07-15 15:04 ` sashiko-bot
2026-07-15 14:47 ` [PATCH 3/8] xor/kunit: fix a spelling error Christoph Hellwig
2026-07-15 14:47 ` [PATCH 4/8] xor/kunit: add a benchmark Christoph Hellwig
2026-07-15 15:05 ` sashiko-bot
2026-07-15 14:47 ` [PATCH 5/8] raid6: enable lock context analysis Christoph Hellwig
2026-07-15 14:47 ` Christoph Hellwig [this message]
2026-07-15 14:47 ` [PATCH 7/8] raid6: improve the runtime selection benchmark Christoph Hellwig
2026-07-15 14:59 ` sashiko-bot
2026-07-15 14:47 ` [PATCH 8/8] raid6/kunit: add a benchmark Christoph Hellwig
2026-07-15 15:01 ` sashiko-bot
-- strict thread matches above, loose matches on Subject: below --
2026-07-08 9:07 misc lib/raid/ improvements Christoph Hellwig
2026-07-08 9:07 ` [PATCH 6/8] raid6: defer implementation selection when built-in Christoph Hellwig
2026-07-08 9:23 ` sashiko-bot
2026-07-08 9:05 misc lib/raid/ improvements Christoph Hellwig
2026-07-08 9:05 ` [PATCH 6/8] raid6: defer implementation selection when built-in Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715144825.95432-7-hch@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=ebiggers@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox