Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3111015imm; Fri, 24 Aug 2018 10:41:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYAoTgrNqITL/6fs6ENuKSKb8RobEOeBEs1s0s8helLkxuHCtj7NSD/MpdgB5MUNrGCMNNE X-Received: by 2002:a63:5660:: with SMTP id g32-v6mr2530996pgm.227.1535132486389; Fri, 24 Aug 2018 10:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535132486; cv=none; d=google.com; s=arc-20160816; b=pdN8hRI2uNriv/z+7gj5QLT1Obb2zq0ZAnfhwQ1eeGlpe8YId9/30cKv6G+zzUIWS4 CIRRKxOlZQgzKi+aHjX21zf7+7x5reK2XZf9vU1/CW61kcGjl2ZDGu7b/tYKVEZWsczC ASs/JC6sq776R7bWUeEjC84XpG3And+mEZR20zM0137skIcuzT+pZwbANiZ9XL64RuzV ZiyRifMI8zWtXqlPT08iu2O/8F4LIBl0c0IbE0R51dPHwIK7s3JpX39Qi2UF1nOdTiN3 etNkslmad3HllT4AckiTif6S2nTHLB9ecrrvdH2gtDsCI1sFwNt6WqqN5HB31yrT+qEI cpVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=iwbWMBkCso+qLTd2UCAKLGBi2iYoAU0GFGbvtER/g9g=; b=Re/xHtTUu+VCfW3ZwNaWN7XmP6/zxUaFAIU4UdglHHg7ovx10dBRgrWMtubgS770Li J5nVp497Aye0OBvp2rri11zXx5b4rCh5u3He/G51A1KRLKMZDvpPfGsQUIoHz2atdrKY Ak2GecHKxqzu/Kie/mWFqelguMx8CXDkwBsQ0vn+GKAhNprA8uVRx75aNCtTi0/DUIFr G9QNao6lXD6PWF0wUI2W8v6K0MAXqiPhU/6++xGo5yKq5LrmCMQZA9kN8apjEGaWpjfz HtUq+th1S4HDUk7hqY6DSHyiRBdbUCw8EbgL1vl/zcmrRyhlpe5sotsXG+0Ru3ysg0Rf WZPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FtYn4IS8; 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 k16-v6si6253900pll.442.2018.08.24.10.41.10; Fri, 24 Aug 2018 10:41:26 -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=FtYn4IS8; 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 S1727463AbeHXVOP (ORCPT + 99 others); Fri, 24 Aug 2018 17:14:15 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36150 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbeHXVOO (ORCPT ); Fri, 24 Aug 2018 17:14:14 -0400 Received: by mail-it0-f65.google.com with SMTP id p16-v6so2929186itp.1 for ; Fri, 24 Aug 2018 10:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iwbWMBkCso+qLTd2UCAKLGBi2iYoAU0GFGbvtER/g9g=; b=FtYn4IS8X1CaLjybliZa+ZXgNQPW9nAawlCV3s//F4fE3x1rKBA9jvo/oXf93ty/tN RseuFtoQtMQH4LdJSeHurfQ/HMyOxCWgPF9A4GNQ7wwdOq5tW52s/TFiHzDINEh5W+EB xWTSg1H9VLwVLcjHH2rD8obVQ47PD7qTo7s38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iwbWMBkCso+qLTd2UCAKLGBi2iYoAU0GFGbvtER/g9g=; b=EoUbRdu3iGbKleofuX2fk8VIX4MSBF6ijP0AH3LMaSTlAxzGBlZ+d1X1r+50uvvrNh jb/MBhK7aZyWjNKFcZFaOlhWZq8Mirmk7Au99Crzf9KY2mSo+t39J2Se2VjUEuWtXHfM tq+DIoyU2gbtsSVxgzH0p6ZfPd3NxNJ7mNbNj/H6pbNguiwUWaJaW8i/regOe/O0R1Zb bP7ftvkoDQAjxv7mvbt7Qo0yIVZWSZIxF/+PuSHYH/IVFbeC+28CbALOh3LX7aY4ApQr nrQ7CwC15dkFAgA429jLNM1iKpduJk+dRimj9HcdUvBtoPguji4vGyuVW1+gq3Gnez09 DJ5w== X-Gm-Message-State: APzg51DJsrCKg/EWoeBSZarQtnRH0YUKcQUDNenh2KeOl0LQ0ug1boCh /yosqXYUczsQHHiYyNb7oKYcD1aM8wTJ2wKocpizlg== X-Received: by 2002:a24:8309:: with SMTP id d9-v6mr2157496ite.123.1535132317619; Fri, 24 Aug 2018 10:38:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Fri, 24 Aug 2018 10:38:36 -0700 (PDT) In-Reply-To: References: <1533928331-21303-1-git-send-email-jeff.lien@wdc.com> <20180822062016.GA10356@infradead.org> From: Ard Biesheuvel Date: Fri, 24 Aug 2018 18:38:36 +0100 Message-ID: Subject: Re: [PATCH] Performance Improvement in CRC16 Calculations. To: "Martin K. Petersen" Cc: Jeffrey Lien , Christoph Hellwig , "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" , David Darrington , Jeff Furlong Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24 August 2018 at 17:29, Martin K. Petersen wrote: > > Ard, > >> Would it be possible to allocate the crypto transform upon first use >> instead of from an initcall? If crc_t10dif() is mostly called from >> non-process context, that would not really work, but otherwise, we >> could simply defer it (and occasional calls from non-process context >> that do occur would use the generic code until the point where another >> call from process context allocates the transform) > > The function is always called from user context. However, postponing the > crypto transform registration doesn't solve the common scenario of the > user booting off of a Fibre Channel/SAS/NVMe device with the desired > crct10dif-pclmul.ko module located on the boot drive. > > If there is no good way to teach crypto to update existing registrations > when a higher priority transformation becomes available, then we > probably need to explore tweaking dracut to unconditionally load > crct10dif-pclmul (and your ARM equivalent). Looks like there are already > hacks in place in dracut to preload crc32c for btrfs and XFS. > I'd prefer to handle this without help from userland. It shouldn't be too difficult to register a module notifier that only sets a flag (or the static key, even?), and to free and re-allocate the crc_t10dif transform if the flag is set. > Anyway. Just seems like the kernel is violating the principle of least > surprise here. The kernel should always pick the best available tool for > the job... > > -- > Martin K. Petersen Oracle Linux Engineering