Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp202268lqg; Fri, 1 Mar 2024 02:37:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQUcX7bwbgsOofz8hiCdRiyCbAPzLgyAxyIIxiix0s6DXLDpmqVtsM1m++aqK/uaEuXzbXQfJbtnPkq/zhiJJ9DUiBgDa1Tp5nTOthAA== X-Google-Smtp-Source: AGHT+IH34yaJmYhL+Nhk/fHI3VFoIZKMqjYf0+9osw0lo0sDnRg9B1TV6t4Lt4ppPunZMYobGcHc X-Received: by 2002:a17:906:f0ce:b0:a44:50bb:8cc2 with SMTP id dk14-20020a170906f0ce00b00a4450bb8cc2mr1305056ejb.28.1709289438174; Fri, 01 Mar 2024 02:37:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709289438; cv=pass; d=google.com; s=arc-20160816; b=xmQg+bVWZjzoCksKPAy1DsPA3tt+lvEtBP7gGliK0mwVx7o8hp5fvXRmwAvS/AWlMR Oj0Y4ypndnPLxZDEsEazATQw1yI004mRiy/J1AyimassqrzZ1AvNsaXSTbR8IWz4lUAT J2uYl19jo5CLKCUKNMbNAPpMhfVoeVPNLcAjHCnF201D/f3pcJHSzp7lqMEAdrFIluYA 6/+QR/ADWDa+iTCm1pB/QfXJAPpcgs6+ALLh1EfD3uVdiQNOVqtpXKJCS0BhM0cZ1tBb 2H1xh6B76XdJUNV7sjg19Wd5ozixG46ZKuIJ5r8M8b4ajWzBeNBsMkjjQ6h/xMt/SpSA 8gyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date; bh=uyTBaYcDxTlFa8lsqA3X2DBfAvz4PWjhhEXrbSIcDl8=; fh=HM9N/egZ6QDLpk4mmfWEd6KJXpoN/1qetPuhhkWYDrc=; b=shy/zDJy67Dg8dhYiNrLRqOoZu+wUQoryUoCB5xex0OIb5mi8CM7N3g21KV+1NHn+v FuEEtw22l6CJHISBW0JwoZ2Ni7vahfiyWG4JIVvyBT1p++WiN87TS7/y4QoH1w89FZq/ e4WiSS6dj01hBkLCw2XL/W/m3BrGZ9zFRCw0v6MhuoF9PAxznDrNYfkKgJyI1YTiJ/bj L1X2E0BBwdXPP5PoBIFE/Zg0Z/fdu2olWgoZp5uEwWgMz/iY8rJWaSdkm/iMaRT+0MFK O8u97qc081IzyWwa1rgVkOXpVsJDB3c77KGR4MEB3CWFzPPHHGzP5Wv24iUceQ6sVKrZ NPnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au dmarc=pass fromdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-crypto+bounces-2421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=QUARANTINE dis=NONE) header.from=apana.org.au Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jo2-20020a170906f6c200b00a3e91ecd95fsi1331555ejb.121.2024.03.01.02.37.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 02:37:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au dmarc=pass fromdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-crypto+bounces-2421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=QUARANTINE dis=NONE) header.from=apana.org.au Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C9E7D1F2588A for ; Fri, 1 Mar 2024 10:37:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB46A16FF46; Fri, 1 Mar 2024 10:37:13 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24F47339B1 for ; Fri, 1 Mar 2024 10:37:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.6.53.87 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709289433; cv=none; b=UPfSt2LAUnLftrTDUDi5d5jMpYxeu54AtIBK8K8ph4lUNWDbNEGSdw1uyza4uQ/t4fd8dpa/faG50hoEHA9Hxt4+MZPWSnJvNOCgbOv3K4FsaWTmfAD/wSwVxrIjqI5YJBpBxO3xixIQmOcSIEebIWKUQ3KbFVotfhCycFbHzqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709289433; c=relaxed/simple; bh=vnrrAWvuoftL1aeJ8dlr+yyTDXmBz2ZGBPG90GMHP14=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=fL4dBlLqJrGLBDF+K2p/SmBkmioyi0MywIQbhgCNci1dUXuYqSdbKp1ooa5glqR5DK1MMuqMj94+CTY0gNPmFBJbycM2VaS0oI2AXupsZ96txCUunbcU/WLha+kq6PFEaNBQDnvmMB7ote6eHUMX8duqZDcYmPO1Szt2oRaVaVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; arc=none smtp.client-ip=144.6.53.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1rg0GG-002HF1-Nv; Fri, 01 Mar 2024 18:37:05 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 01 Mar 2024 18:37:19 +0800 Date: Fri, 1 Mar 2024 18:37:19 +0800 From: Herbert Xu To: Eric Biggers Cc: linux-crypto@vger.kernel.org, clabbe@baylibre.com Subject: Re: [RFC PATCH] crypto: remove CONFIG_CRYPTO_STATS Message-ID: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240223090334.167519-1-ebiggers@kernel.org> X-Newsgroups: apana.lists.os.linux.cryptoapi Eric Biggers wrote: > From: Eric Biggers > > Remove support for the "Crypto usage statistics" feature > (CONFIG_CRYPTO_STATS). This feature does not appear to have ever been > used, and it is harmful because it significantly reduces performance and > is a large maintenance burden. > > Covering each of these points in detail: > > 1. Feature is not being used > > Since these generic crypto statistics are only readable using netlink, > it's fairly straightforward to look for programs that use them. I'm > unable to find any evidence that any such programs exist. For example, > Debian Code Search returns no hits except the kernel header and kernel > code itself and translations of the kernel header: > https://codesearch.debian.net/search?q=CRYPTOCFGA_STAT&literal=1&perpkg=1 > > The patch series that added this feature in 2018 > (https://lore.kernel.org/linux-crypto/1537351855-16618-1-git-send-email-clabbe@baylibre.com/) > said "The goal is to have an ifconfig for crypto device." This doesn't > appear to have happened. > > It's not clear that there is real demand for crypto statistics. Just > because the kernel provides other types of statistics such as I/O and > networking statistics and some people find those useful does not mean > that crypto statistics are useful too. > > Further evidence that programs are not using CONFIG_CRYPTO_STATS is that > it was able to be disabled in RHEL and Fedora as a bug fix > (https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2947). > > Even further evidence comes from the fact that there are and have been > bugs in how the stats work, but they were never reported. For example, > before Linux v6.7 hash stats were double-counted in most cases. > > There has also never been any documentation for this feature, so it > might be hard to use even if someone wanted to. > > 2. CONFIG_CRYPTO_STATS significantly reduces performance > > Enabling CONFIG_CRYPTO_STATS significantly reduces the performance of > the crypto API, even if no program ever retrieves the statistics. This > primarily affects systems with large number of CPUs. For example, > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039576 reported > that Lustre client encryption performance improved from 21.7GB/s to > 48.2GB/s by disabling CONFIG_CRYPTO_STATS. > > It can be argued that this means that CONFIG_CRYPTO_STATS should be > optimized with per-cpu counters similar to many of the networking > counters. But no one has done this in 5+ years. This is consistent > with the fact that the feature appears to be unused, so there seems to > be little interest in improving it as opposed to just disabling it. > > It can be argued that because CONFIG_CRYPTO_STATS is off by default, > performance doesn't matter. But Linux distros tend to error on the side > of enabling options. The option is enabled in Ubuntu and Arch Linux, > and until recently was enabled in RHEL and Fedora (see above). So, even > just having the option available is harmful to users. > > 3. CONFIG_CRYPTO_STATS is a large maintenance burden > > There are over 1000 lines of code associated with CONFIG_CRYPTO_STATS, > spread among 32 files. It significantly complicates much of the > implementation of the crypto API. After the initial submission, many > fixes and refactorings have consumed effort of multiple people to keep > this feature "working". We should be spending this effort elsewhere. > > Cc: Corentin Labbe > Signed-off-by: Eric Biggers > --- > arch/s390/configs/debug_defconfig | 1 - > arch/s390/configs/defconfig | 1 - > crypto/Kconfig | 20 --- > crypto/Makefile | 2 - > crypto/acompress.c | 47 +---- > crypto/aead.c | 84 +-------- > crypto/ahash.c | 63 +------ > crypto/akcipher.c | 31 ---- > crypto/compress.h | 5 - > crypto/{crypto_user_base.c => crypto_user.c} | 10 +- > crypto/crypto_user_stat.c | 176 ------------------- > crypto/hash.h | 30 ---- > crypto/kpp.c | 30 ---- > crypto/lskcipher.c | 73 +------- > crypto/rng.c | 44 +---- > crypto/scompress.c | 8 +- > crypto/shash.c | 75 +------- > crypto/sig.c | 13 -- > crypto/skcipher.c | 86 +-------- > crypto/skcipher.h | 10 -- > include/crypto/acompress.h | 90 +--------- > include/crypto/aead.h | 21 --- > include/crypto/akcipher.h | 78 +------- > include/crypto/algapi.h | 3 - > include/crypto/hash.h | 22 --- > include/crypto/internal/acompress.h | 7 +- > include/crypto/internal/cryptouser.h | 16 -- > include/crypto/internal/scompress.h | 8 +- > include/crypto/kpp.h | 58 +----- > include/crypto/rng.h | 51 +----- > include/crypto/skcipher.h | 25 --- > include/uapi/linux/cryptouser.h | 28 +-- > 32 files changed, 77 insertions(+), 1139 deletions(-) > rename crypto/{crypto_user_base.c => crypto_user.c} (98%) > delete mode 100644 crypto/crypto_user_stat.c > delete mode 100644 include/crypto/internal/cryptouser.h Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt