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 BDFF3FEE4C6 for ; Sat, 28 Feb 2026 07:36:12 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9PhQly7rUsRozTK29SHfg4Ao9vIqPPyqPn5Fj0sIf7Q=; b=k6jbcObK1dEVeJ aivvguqn01A63PHN3zSc1bSd8wYy1UNQDJKDYaDKGCEdGIv8OCX4IbBVgrKWOSKA3RQYHrnWxq29l eqENzhaL0O/06MbrH4npPuWN/H3AaC57SztFO5UQBjdeuIlVdY6IEMfmej2J7DiPx9Y4EsTC+N8Jv oSe7wL9WTvcxBg+AOpq+mJZC/tmJnrvSzhuse29KZ5RsNVFnlLSFMbyrZZhaQSEMLN8iHvAyt/d3a joIT0OhKIFkLJ57kVICPa/r+CxmFm4LoPhcSBQqL9EHsjaLkjJOjLOrzne+cL6OFs+E8zr5IyWpCk AQrky50i3aQ2um0zbqiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vwEro-00000009cVT-3msg; Sat, 28 Feb 2026 07:36:00 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vwErm-00000009cVH-2rMF; Sat, 28 Feb 2026 07:35:58 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 3203760122; Sat, 28 Feb 2026 07:35:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7026C116D0; Sat, 28 Feb 2026 07:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772264156; bh=6sJNyE+VY1nO/tYyDnefgTdhbr4qcMLaxVtizhQQLOk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N9tdtdMWAI5Ijh2x1iw7nM2tuOn7VcN+8js+7SLSFQBQ9vU2vt9oqu+EgowziSK73 sAzO21bZJQxKxmtHlu0vSUH2tGUcQRgjFGbZX7mbQPKN8WjwpFmWL8+xDtI3qS0EtF 4Jfc+10mCY+RphkrG2fcHyK/TMz2wuYQYlWWVT80/0ZLPVgACgd9amxPCn3FPf0AgL JgqFFYCABzbxFrg5KHqTTW/MBNJ7iUh+0uZMyEIV2cew4CSOzs95au6LqecDztGc2s U0mqa9zSxlhCMSe8/lU1BD692HSjIX3cPWlCgttoWYJBTO4L+PB6fHsLYOLKccSpod azry3uoyDBKgg== Date: Fri, 27 Feb 2026 23:35:53 -0800 From: Eric Biggers To: Christoph Hellwig Cc: Andrew Morton , Richard Henderson , Matt Turner , Magnus Lindholm , Russell King , Catalin Marinas , Will Deacon , 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 , "David S. Miller" , Andreas Larsson , Richard Weinberger , Anton Ivanov , Johannes Berg , 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-alpha@vger.kernel.org, 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, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-crypto@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-arch@vger.kernel.org, linux-raid@vger.kernel.org Subject: Re: cleanup the RAID5 XOR library Message-ID: <20260228073553.GL65277@quark> References: <20260226151106.144735-1-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260226151106.144735-1-hch@lst.de> 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 On Thu, Feb 26, 2026 at 07:10:12AM -0800, Christoph Hellwig wrote: > Hi all, > > the XOR library used for the RAID5 parity is a bit of a mess right now. > The main file sits in crypto/ despite not being cryptography and not > using the crypto API, with the generic implementations sitting in > include/asm-generic and the arch implementations sitting in an asm/ > header in theory. The latter doesn't work for many cases, so > architectures often build the code directly into the core kernel, or > create another module for the architecture code. > > Changes this to a single module in lib/ that also contains the > architecture optimizations, similar to the library work Eric Biggers > has done for the CRC and crypto libraries later. After that it changes > to better calling conventions that allow for smarter architecture > implementations (although none is contained here yet), and uses > static_call to avoid indirection function call overhead. > > A git tree is also available here: > > git://git.infradead.org/users/hch/misc.git xor-improvements > > Gitweb: > > https://git.infradead.org/?p=users/hch/misc.git;a=shortlog;h=refs/heads/xor-improvements Overall this looks great. xor_gen() really needs a KUnit test, though. Without that, how was this tested? Later we should remove some of the obsolete implementations, such as the alpha or x86 MMX ones. Those platforms have no optimized code in lib/crc/ or lib/crypto/, and I doubt anyone cares. But that should be a separate series later: porting them over unchanged is the right call for now so that this series doesn't get blocked on debates about removals... Also, I notice that no one has optimized this for the latest x86_64 CPUs by using the vpternlogd instruction to do 3-input XORs. That would be another good future project. - Eric _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv