From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69796CD4851 for ; Tue, 12 May 2026 05:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ifi4HevLkylJtOed48ED9jpCgyImSVPc5X3+lzdzXiw=; b=bArblZLmA/XF59 EUleDIboPrmFvc65ejYXGGOe6nasnOp6wys2tAyS7+qCVZ/MKF+Gq/l69kMoGG1SGUGZy7P17JVCk ZRedSGj3Iq4iarcCO0OPLzy/+otSfe+AV8cXCLRe20bcDVcKJKF/pbAtg1Ub25XnsvZ/MJoPdvOwy Cc9lkc2bMH/TAuuXee/anEXGmwC4aR7NyGGTkecksI5UHlEvFCfRR9uo2TIc6a9LgSWf6VsvliSwq yvWDB3UkSD0w3/4BTui1mpqh9s+WHFKBA7KCdH/qdkw4yOsINJ7FIJ6nIq1Gt4jKgojVikoA++991 I5lsx4Vy/wYSgz0sYTpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wMfc2-0000000FcS8-0vgm; Tue, 12 May 2026 05:24:58 +0000 Received: from 2a02-8389-2341-5b80-decc-1a96-daaa-a2cc.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:decc:1a96:daaa:a2cc] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wMfbz-0000000FcGb-2ne1; Tue, 12 May 2026 05:24:56 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Huacai Chen , WANG Xuerui , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Herbert Xu , Dan Williams , Chris Mason , David Sterba , Arnd Bergmann , Song Liu , Yu Kuai , Li Nan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-arch@vger.kernel.org, linux-raid@vger.kernel.org Subject: [PATCH 12/19] raid6: use static_call for raid6_recov_2data and raid6_recov_datap Date: Tue, 12 May 2026 07:20:52 +0200 Message-ID: <20260512052230.2947683-13-hch@lst.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260512052230.2947683-1-hch@lst.de> References: <20260512052230.2947683-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Avoid expensive indirect calls for the recovery routines as well. Signed-off-by: Christoph Hellwig --- lib/raid/raid6/algos.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/raid/raid6/algos.c b/lib/raid/raid6/algos.c index 65b75236ecf8..d333318e3301 100644 --- a/lib/raid/raid6/algos.c +++ b/lib/raid/raid6/algos.c @@ -26,6 +26,8 @@ static const struct raid6_recov_calls *raid6_recov_algo; /* Selected algorithm */ DEFINE_STATIC_CALL_NULL(raid6_gen_syndrome_impl, *raid6_intx1.gen_syndrome); DEFINE_STATIC_CALL_NULL(raid6_xor_syndrome_impl, *raid6_intx1.xor_syndrome); +DEFINE_STATIC_CALL_NULL(raid6_recov_2data_impl, *raid6_recov_intx1.data2); +DEFINE_STATIC_CALL_NULL(raid6_recov_datap_impl, *raid6_recov_intx1.datap); /** * raid6_gen_syndrome - generate RAID6 P/Q parity @@ -126,7 +128,7 @@ void raid6_recov_2data(int disks, size_t bytes, int faila, int failb, WARN_ON_ONCE(bytes > PAGE_SIZE); WARN_ON_ONCE(failb <= faila); - raid6_recov_algo->data2(disks, bytes, faila, failb, ptrs); + static_call(raid6_recov_2data_impl)(disks, bytes, faila, failb, ptrs); } EXPORT_SYMBOL_GPL(raid6_recov_2data); @@ -151,7 +153,7 @@ void raid6_recov_datap(int disks, size_t bytes, int faila, void **ptrs) WARN_ON_ONCE(bytes & 511); WARN_ON_ONCE(bytes > PAGE_SIZE); - raid6_recov_algo->datap(disks, bytes, faila, ptrs); + static_call(raid6_recov_datap_impl)(disks, bytes, faila, ptrs); } EXPORT_SYMBOL_GPL(raid6_recov_datap); @@ -324,6 +326,8 @@ static int __init raid6_init(void) */ if (!raid6_recov_algo) raid6_recov_algo = &raid6_recov_intx1; + static_call_update(raid6_recov_2data_impl, raid6_recov_algo->data2); + static_call_update(raid6_recov_datap_impl, raid6_recov_algo->datap); pr_info("raid6: using %s recovery algorithm\n", raid6_recov_algo->name); #ifdef MODULE -- 2.53.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv