From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96E2A1CDFCA for ; Sun, 29 Mar 2026 21:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774821429; cv=none; b=b/sNZsxBkFqboXXuLK3UoMFbGQT5cJevFah8KMcJuyS+S3QGcLcYFjubaDgyd0WgrooiVAI4Nzgd+NV49pJ1JZR/PCEyZTKLDHTikgSM9cfShcuwQD2qTCPfsCfzKWdIWYAoof76bdPA4PiTMIEQJ7sOtx8yONzunPPVawnXHqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774821429; c=relaxed/simple; bh=WnfU5UGN+TVTG1dIBUcOpKv+B6jRulWifk7HcxeXPHQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qlvYtTL4RDmWw14Jp8RdDmoSJ5phjg9GpuZAeB6zTYiRLINdRBzPUTfoohToDVgZYWGrpOIyrjppUqO1nxB1893TsMoEm4YHoiCnvLMwoUw/60JROCamfNJ8x4ckslXzQ0NAHzaxFfgTeQTCAAA1//cuZwv8LQhjnjSPrITnRP0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lmp5AdmJ; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lmp5AdmJ" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-43cfce3a195so226252f8f.2 for ; Sun, 29 Mar 2026 14:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774821426; x=1775426226; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=/PPpHwpK+XhWFnGV+Za6xJpLzu8J3tufoqK8mJt5f1M=; b=lmp5AdmJR9l8tPsZTiuNS6f3uQKdC9KB9eYIlgzkwuix9rYyqhIGpClT9zUP/IhZFO DrVUagNIT09oIP4a8TIvGf/8vl0dHhbTBM4EPQSqdrIu5Brm2AfQ2TG/Vex8s24AOQiT XCmCYzF/G0HR0Q7xmrEf6oIXWsLlcks9Y3sxL/XFNL+/zkhBnIbHDoOk/NhxE68zFoST iDxVk2eB1nIfLHLI3OkrzWsTsXWznz8NKnVJNcq8DxJkpfQSl7xesBecRpSw83tXpSz/ gWZhDv1cjFF0UqLv+ybSoMSM8+AGzrlVvsZ6xyn7z/EVsL+iLbHcNyQNtabWcOfG7GIm eTXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774821426; x=1775426226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/PPpHwpK+XhWFnGV+Za6xJpLzu8J3tufoqK8mJt5f1M=; b=nx2RGWqINcBxcmjF2QSFVFrMdbI1MsSU7fjNE2cxhiIDEd4odY/eWtqadJey4toHZr MmcZgH9TAiOiJ/JvL0VygKftubhQOOH/Srl9QySJNvIzigX1Gfmfb3dIoQ8T7hTKMweS Es86a5DcOGzH9lzEzFR1tBiq10nmj9Y1/834QRhh69jq+DuogVLdHk5IoxEJuzUuw2B2 txcH3z4qXDlkb5xAZq8gk9A8D1SYUI45Bp5/cSdiFwMIBgumZbyHndNUiLUeiOyCcRsZ nYTgJ7qDLo8PP7G+q4BQKsI+2w2zdXXxaBJuec1AmkCNOPi9mtw2IwcdHvMgkChQJo9b qVgw== X-Forwarded-Encrypted: i=1; AJvYcCUNLjoUVxstFjIeap1xU2WEBW77IeeWYI2TlN+e53QNYZVs8Sg/NqU1U+dyuRl30fAgitER7yE5c9F8I0c=@vger.kernel.org X-Gm-Message-State: AOJu0YxcGqM5Cpx7Lb1wO0hQhCTzZHjEl0nYshLyT5z/P2sulnyAXGp8 7eiluzysKHp1tAz9u3DXcFBG7bONK5Q8f86ZYo/mGz5aiSDslfI8gFUo X-Gm-Gg: ATEYQzzA8Bgm4HfvdNRttwf30FZsOGX2Xg9LjOXZTGkmw4CD7bilmq925wRwNzHh3F/ nbOedFEyVrRQG3LHlNYw9gIj5d38sLQtjgpdQSX0fj+uO85XZvEYC+3+aDVEZP2XGLcD3gAqV3y KrjVTTFlvNMmN+3og63FIgnM7bhX8f89za5U/bdg8n0IA3+rPKYVMdVeVZT+1b6EZ4wybFQXtGM ES9rgh5X1Yx+d7G30P/H8U0II14r5iXQfvtD/3xjphg7AgHIXUmbKJ2vlYJW/1C2jD/yX7RWpqT Rcmpa8HgBqA3gw8NEumMyRrshM1l68BkE2BvZppdHt0TesMEDGNn10poJhfWYb8WlR7vMm7jAUt E9iUX8FDUQWls88W27rFPTV5b1BWUfV+jAx5Njs7I2y/ST/IAXRWydZ1N4cb12thAQEY32OHXuJ SwdPZ9QZzMVZlQ/bljvUOZAkGWXu2G/d4bX1YJwCtxMBs8LMoHkLSoKUhGcso1CIoc X-Received: by 2002:a05:6000:400f:b0:43c:fdd9:188f with SMTP id ffacd0b85a97d-43cfdd919d1mr3533554f8f.23.1774821425608; Sun, 29 Mar 2026 14:57:05 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43cf21e3602sm14596947f8f.4.2026.03.29.14.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2026 14:57:05 -0700 (PDT) Date: Sun, 29 Mar 2026 22:57:04 +0100 From: David Laight To: Eric Biggers Cc: Demian Shulhan , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ardb@kernel.org Subject: Re: [PATCH v3] lib/crc: arm64: add NEON accelerated CRC64-NVMe implementation Message-ID: <20260329225704.0eb82966@pumpkin> In-Reply-To: <20260329203829.GA2746@quark> References: <20260317065425.2684093-1-demyansh@gmail.com> <20260329074338.1053550-1-demyansh@gmail.com> <20260329203829.GA2746@quark> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 29 Mar 2026 13:38:29 -0700 Eric Biggers wrote: > On Sun, Mar 29, 2026 at 07:43:38AM +0000, Demian Shulhan wrote: > > Implement an optimized CRC64 (NVMe) algorithm for ARM64 using NEON > > Polynomial Multiply Long (PMULL) instructions. The generic shift-and-XOR > > software implementation is slow, which creates a bottleneck in NVMe and > > other storage subsystems. > > > > The acceleration is implemented using C intrinsics () rather > > than raw assembly for better readability and maintainability. > > > > Key highlights of this implementation: > > - Uses 4KB chunking inside scoped_ksimd() to avoid preemption latency > > spikes on large buffers. > > - Pre-calculates and loads fold constants via vld1q_u64() to minimize > > register spilling. > > - Benchmarks show the break-even point against the generic implementation > > is around 128 bytes. The PMULL path is enabled only for len >= 128. Final thought: Is that allowing for the cost of kernel_fpu_begin()? - which I think only affects the first call. And the cost of the data-cache misses for the lookup table reads? - again worse for the first call. David > > > > Performance results (kunit crc_benchmark on Cortex-A72): > > - Generic (len=4096): ~268 MB/s > > - PMULL (len=4096): ~1556 MB/s (nearly 6x improvement) > > > > Signed-off-by: Demian Shulhan > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=crc-next > > Thanks! > > - Eric >