Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp575580imm; Fri, 10 Aug 2018 17:36:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx8T8/4GCc64zp101c8znrEW5hZilvgKLVXjeuVCxYFb+fPDIX1vHTeiAHPXvaoxcpGPvHi X-Received: by 2002:a17:902:7803:: with SMTP id p3-v6mr7831683pll.119.1533947780428; Fri, 10 Aug 2018 17:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533947780; cv=none; d=google.com; s=arc-20160816; b=OIVznfoAhbyHHpQFR0kg0OENx+KhzBT2YKLU6ZtDvmkWcpQRzWX+pwmMgMMBazfh5K MGuFGModxS8ljyBA2DjvbPOv3HbKUnl+tZlnzMV00gO5wFXO6aupSOGjQxNnqWTgH2Pq s7WlnNg1gbrdPDbskLEcRmX/jGrxv3FJ0KVA0EHjEeWJmu46mIpcQlZFBeTZfQU9RrVy 68Kr3OnnDv3RJ8PE8q6s+hFUHBPHzE07QUhkQDneMOJaS20+y5a2nyfyDPy+ZPF/KxLi 45wSL7TnZCdSM2kH1BEqaRcS8bDNbLQGquUWNnwrEbme9m08SyOw0qNNjHXovXDjBTiF BHiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=qjpWyHbFeAtpFdsgKiqboTNlIPziBETkN4ecKbIrDsc=; b=sg2P1PKMTJEvLp49XY3IG+7Pp98NmscZGkjqF4mMzbo8G60D9ysO48HRFSwQKpJ4sq PcbezOjeLbaYzHt6EI8ehH309C0CP5YnyuFpk03OV+gvWy3I6oMBoHvic/eiYEQo4c6t TvUK6+seGatGyFMyyoHlws7trqrGTKRmeOx4vtMk3jERwLIpt6T34L6lUer1wGNyxJ+l 0kSB235mFRtGRLc4de4fUPuYe1wC6M5FaMGMjxRrYzFeAmqSaNasjl2mhm9TYQrsOULz fI8rrP0bkFbgZtRC7VCiGP1f9052MMVSI6SsJM3oOcYG9yQpU8FAo/ecI5HrPQYuFnF/ Br5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ROdHhA7N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193-v6si11403060pgh.407.2018.08.10.17.36.05; Fri, 10 Aug 2018 17:36:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ROdHhA7N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727219AbeHKDGk (ORCPT + 99 others); Fri, 10 Aug 2018 23:06:40 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33149 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbeHKDGj (ORCPT ); Fri, 10 Aug 2018 23:06:39 -0400 Received: by mail-qt0-f193.google.com with SMTP id c15-v6so12205209qtp.0 for ; Fri, 10 Aug 2018 17:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=qjpWyHbFeAtpFdsgKiqboTNlIPziBETkN4ecKbIrDsc=; b=ROdHhA7NJzQk2woTyRiFM9wOnh5N7uJR3xDmTDChGsqejJkIAX5Jz0yvpOIeOhc8yu CN54RoyybYfWL8CSPAKbOYiwUfOvvF/6lqRP/JvIv0T1wVzZG/bGjH1Fp9hR2yQJQo4t oN7qQXPCkhe2Q4LWEsb35drAeyUTnOdK1QS6g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=qjpWyHbFeAtpFdsgKiqboTNlIPziBETkN4ecKbIrDsc=; b=cnUdWml1DMMbtdlooU+OgncLk5mAuMXPFnslCw1J38gL6QV9JrqfyA38y2bsSG77ZX uqhyFTREVPbjZOj8lvjz5pVR9mAWz1CHybyjMBm6l6GtkQqiIwBgJERSnlae0yXmkAMI T5NfylHGX8bccRunFrQLHpRo5sUGu8LH/OCGfw7w8Ae1t2iCMlG/pmtJEsK8OHkIP49I rw5Uhwrq2BjYNhUSSDQhLPkQnIzwMGXTl5CjjLxgmkRKq6iRISCRuQ2Cr6ix7FxYWgG/ dU/yREHJQpZWHPA8L8JYGhWSLJBb8A6hRjWWkPcRKtHEDAZ41K7F4CcxgWgDx08YstfU bsHQ== X-Gm-Message-State: AOUpUlHQBxhJ3ULjNHf5XeYTrOUFBCA9YyHCF3SsHPvNv0yAeitMvBO8 hAUd05fsUhj7HyOHi46Y4esTzw== X-Received: by 2002:ac8:6c8:: with SMTP id j8-v6mr8298672qth.314.1533947667190; Fri, 10 Aug 2018 17:34:27 -0700 (PDT) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id q195-v6sm6773790qke.13.2018.08.10.17.34.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Aug 2018 17:34:26 -0700 (PDT) Date: Fri, 10 Aug 2018 20:34:25 -0400 (EDT) From: Nicolas Pitre To: Joe Perches cc: Jeff Lien , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, herbert@gondor.apana.org.au, tim.c.chen@linux.intel.com, martin.petersen@oracle.com, david.darrington@wdc.com, jeff.furlong@wdc.com Subject: Re: [PATCH] Performance Improvement in CRC16 Calculations. In-Reply-To: Message-ID: References: <1533928331-21303-1-git-send-email-jeff.lien@wdc.com> <9b5b906f42dfab78f382c90f66851717d258a15d.camel@perches.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Aug 2018, Joe Perches wrote: > On Fri, 2018-08-10 at 16:02 -0400, Nicolas Pitre wrote: > > On Fri, 10 Aug 2018, Joe Perches wrote: > > > > > On Fri, 2018-08-10 at 14:12 -0500, Jeff Lien wrote: > > > > This patch provides a performance improvement for the CRC16 calculations done in read/write > > > > workloads using the T10 Type 1/2/3 guard field. For example, today with sequential write > > > > workloads (one thread/CPU of IO) we consume 100% of the CPU because of the CRC16 computation > > > > bottleneck. Today's block devices are considerably faster, but the CRC16 calculation prevents > > > > folks from utilizing the throughput of such devices. To speed up this calculation and expose > > > > the block device throughput, we slice the old single byte for loop into a 16 byte for loop, > > > > with a larger CRC table to match. The result has shown 5x performance improvements on various > > > > big endian and little endian systems running the 4.18.0 kernel version. > > > > > > Thanks. > > > > > > This seems a sensible tradeoff for the 4k text size increase. > > > > More like 7.5KB. Would be best if this was configurable so the small > > version remained available. > > Maybe something like: (compiled, untested) > --- > crypto/Kconfig | 10 + > crypto/crct10dif_common.c | 543 +++++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 549 insertions(+), 4 deletions(-) > > diff --git a/crypto/Kconfig b/crypto/Kconfig > index f3e40ac56d93..88d9d17bb18a 100644 > --- a/crypto/Kconfig > +++ b/crypto/Kconfig > @@ -618,6 +618,16 @@ config CRYPTO_CRCT10DIF > a crypto transform. This allows for faster crc t10 diff > transforms to be used if they are available. > > +config CRYPTO_CRCT10DIF_TABLE_SIZE > + int "Size of CRCT10DIF crc tables (as a power of 2)" > + depends on CRYPTO_CRCT10DIF > + range 1 5 > + default 1 if EMBEDDED > + default 5 You could even make the prompt depend on EXPERT. I like it! Acked-by: Nicolas Pitre Nicolas