Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp692887pxb; Thu, 5 Nov 2020 10:23:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcxX8Xx4IelxKzN9SSfB7Ezk+ZGAqpL5teZyqr3+q+CxUzRUHO8pi9fInqY3kUHIRqakJK X-Received: by 2002:a50:8b65:: with SMTP id l92mr4063983edl.132.1604600607792; Thu, 05 Nov 2020 10:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604600607; cv=none; d=google.com; s=arc-20160816; b=Aco1NaqfwSrrmRu2sTVrB8AyISw6uIIAPvj9G93LKB5WBJcXWuKQgWXXlpsdhJNv1t ViJ1+jgtsrKb5531mTuvzaHYfy0ePrTErcuzY2z/1ccFPJ5v39kc8ABcBqffmdaWhDWt /UpPKzReHNTh6eUYtLddTe0jOhFTvfkrVKxHyYtd1e8jcS0OTdqTj6A3g1uB03OYyV7U m9U7yp+F6pcFJwf96SlwPs1ZgYKtp/hczL2rnVYNtHfla3RNpIN33CF5oBFdZjQNsxMN VZGKiFhHvpUf1jDO6I7aihYjOUER8alZpe5aoZeGM4+PizczNbQnPuQ7mwKV9U/KZEEi mo2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eZRT3O9q2Xgs912aCAANlDWFHK0GvuKzoCmgagQ1viE=; b=1AiAPMiRWh43ttncIQgVjGvIJiDvLCrGeNzYOmVb3mIcZLOxdnTBuyJZAeha/qU9JC 0lzemiLdv6HICGjZJIEGW5Gk+Zq3tvYb72UH9I2qcv8YdkyJQO0H60TvM2tc4CJ5L80x PVo4Kx1umEpPeC0G9g6V3gIdVcJ2Ny9phZRnYoCdBHvFxl4cbLSdUjTc//nydiFFb0vf AqkjMNuGlXmFHFve3MTjnFH9EBkWsSaGHKQj26ct99sG4Cml3QSP2tXeUhPLbbHfkFIg foC8BzyY9iRGpCXXdRx37mDbRrjl99hX+iI8Nyg3fp89MC4VPTzc+WcIGtb86YjLWDUl PRYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BIrK13uq; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qq25si1663047ejb.546.2020.11.05.10.22.52; Thu, 05 Nov 2020 10:23:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BIrK13uq; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbgKESV6 (ORCPT + 99 others); Thu, 5 Nov 2020 13:21:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:45458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729783AbgKESV6 (ORCPT ); Thu, 5 Nov 2020 13:21:58 -0500 Received: from gmail.com (unknown [104.132.1.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A63062078E; Thu, 5 Nov 2020 18:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604600517; bh=+OtMxMqFHQbVi8HakvWqVl7xz/M4YezzWnkgDLi3czE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BIrK13uqz3GXI6KOTz/+g9XFoSvg3wJWzrlyNeeJ62M9XfUU7GZkaN+PV977Q+DPd ghDTCMIQiTHAQDJh+Is4xSutKF/lrjhoK0ywBiQdw+WYN8+me/UNg8A0OulrPvGxue dBkEVpgdKxbTcwRETNSmrGPbB3Z8f70ERpnXPxEM= Date: Thu, 5 Nov 2020 10:21:55 -0800 From: Eric Biggers To: Li Qiang Cc: Ard Biesheuvel , Herbert Xu , "David S. Miller" , Catalin Marinas , Will Deacon , Maxime Coquelin , Alexandre Torgue , Linux ARM , Linux Crypto Mailing List Subject: Re: [PATCH 1/1] arm64: Accelerate Adler32 using arm64 SVE instructions. Message-ID: <20201105182155.GA2555324@gmail.com> References: <20201103121506.1533-1-liqiang64@huawei.com> <20201103121506.1533-2-liqiang64@huawei.com> <20201104175742.GA846@sol.localdomain> <2dad168c-f6cb-103c-04ce-cc3c2561e01b@huawei.com> <5b528637-5cb9-a134-2936-7925afae95c6@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5b528637-5cb9-a134-2936-7925afae95c6@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Nov 05, 2020 at 05:05:53PM +0800, Li Qiang wrote: > > > 在 2020/11/5 15:51, Ard Biesheuvel 写道: > > Note that NEON intrinsics can be compiled for 32-bit ARM as well (with > > a bit of care - please refer to lib/raid6/recov_neon_inner.c for an > > example of how to deal with intrinsics that are only available on > > arm64) and are less error prone, so intrinsics should be preferred if > > feasible. > > > > However, you have still not explained how optimizing Adler32 makes a > > difference for a real-world use case. Where is libdeflate used on a > > hot path? > > . > > Sorry :(, I have not specifically searched for the use of this algorithm > in the kernel. > > When I used perf to test the performance of the libz library before, > I saw that the adler32 algorithm occupies a lot of hot spots.I just > saw this algorithm used in the kernel code, so I think optimizing this > algorithm may have some positive optimization effects on the kernel.:) Adler32 performance is important for zlib compression/decompression, which has a few use cases in the kernel such as btrfs compression. However, these days those few kernel use cases are mostly switching to newer algorithms like lz4 and zstd. Also as I mentioned, your patch doesn't actually wire up your code to be used by the kernel's implementation of zlib compression/decompression. I think you'd be much better off contributing to a userspace project, where DEFLATE/zlib/gzip support still has a long tail of use cases. The official zlib isn't really being maintained and isn't accepting architecture-specific optimizations, but there are some performance-oriented forks of zlib (e.g. https://chromium.googlesource.com/chromium/src/third_party/zlib/ and https://github.com/zlib-ng/zlib-ng), as well as other projects like libdeflate (https://github.com/ebiggers/libdeflate). Generally I'm happy to accept architecture-specific optimizations in libdeflate, but they need to be testable. - Eric