From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2EB2C02198 for ; Sun, 16 Feb 2025 05:10:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3590028001D; Sun, 16 Feb 2025 00:10:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 308E928001A; Sun, 16 Feb 2025 00:10:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F82828001D; Sun, 16 Feb 2025 00:10:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0240428001A for ; Sun, 16 Feb 2025 00:10:46 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8B4B8A27B8 for ; Sun, 16 Feb 2025 05:10:46 +0000 (UTC) X-FDA: 83124632892.03.9AC2527 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by imf17.hostedemail.com (Postfix) with ESMTP id E883D40014 for ; Sun, 16 Feb 2025 05:10:43 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=hmeau.com header.s=formenos header.b=b7E6XKQc; spf=pass (imf17.hostedemail.com: domain of herbert@gondor.apana.org.au designates 144.6.53.87 as permitted sender) smtp.mailfrom=herbert@gondor.apana.org.au; dmarc=pass (policy=quarantine) header.from=apana.org.au ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739682645; a=rsa-sha256; cv=none; b=wdKf3+OwZtUTkIWQYzNGBwdsBzvD7FBxzc44q/jEo5fYZA1PZ/toEt12Mcue1jeDwGcQoR 0OGujxzqKvK/2rUt6hIr6ZGgzXgdQuGtVsIb/7HVvGTwB2CJEE8qELT0ukUHDO8HmbVIGi CWm0RRw1z3mfPkwMO6Nx8+gMtxbeDdA= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=hmeau.com header.s=formenos header.b=b7E6XKQc; spf=pass (imf17.hostedemail.com: domain of herbert@gondor.apana.org.au designates 144.6.53.87 as permitted sender) smtp.mailfrom=herbert@gondor.apana.org.au; dmarc=pass (policy=quarantine) header.from=apana.org.au ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739682645; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=f7RtmdJ5KUIMrq7cdsN0B5NpP3HuWU6euFmNqdKBSyI=; b=nLMWyy3n632b13BjNYA+mH3SmvqBYxL8p380CK4IepKFt3zvsCtTk2oRL2IUNTFk2IXqhd hN+T0xilKuZOmv6SlCwG8mjWp0vJmhtMfIPZB5HwHuRnsNeU6iphP9e/0se5XVcLamt52u ZtabdK2jeowBlrZ/7XR4ePt2trffAO4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hmeau.com; s=formenos; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=f7RtmdJ5KUIMrq7cdsN0B5NpP3HuWU6euFmNqdKBSyI=; b=b7E6XKQcwZN+hBGza39tXleN3N Xt9v5FVAp/ZwfgnY4DUExKVNDa6dP/A1JX3Ii7w3YDwX7OIY4gkNS95QpotHbBWqAjIGlbX2Kweub kkU8NX7/RZU62dxoo6G6t9qVeaeEhtdBxPUEeNKlo7CpxeftnwffR4afRRnXX+biLyOxf6maoj9rr 47vvzsils+IYKF1752cVzPg2Qzc0EqXrdTx7UAMRrqGE50qB2xO8UCLDZaQHKmXJeZEMryysBLYq2 fcFUCcSNyYDpE7+fvsOylCG12Ze4i93hqlgPXe8A9UibQsKMY5F4aKscNJydBs4AZ/1cl8JzGEkdF d6YNfzlw==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1tjWiR-000hE4-2l; Sun, 16 Feb 2025 13:10:37 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Sun, 16 Feb 2025 13:10:36 +0800 Date: Sun, 16 Feb 2025 13:10:36 +0800 From: Herbert Xu To: Kanchana P Sridhar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, yosry.ahmed@linux.dev, nphamcs@gmail.com, chengming.zhou@linux.dev, usamaarif642@gmail.com, ryan.roberts@arm.com, 21cnbao@gmail.com, akpm@linux-foundation.org, linux-crypto@vger.kernel.org, davem@davemloft.net, clabbe@baylibre.com, ardb@kernel.org, ebiggers@google.com, surenb@google.com, kristen.c.accardi@intel.com, wajdi.k.feghali@intel.com, vinodh.gopal@intel.com Subject: Re: [PATCH v6 02/16] crypto: acomp - Define new interfaces for compress/decompress batching. Message-ID: References: <20250206072102.29045-1-kanchana.p.sridhar@intel.com> <20250206072102.29045-3-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250206072102.29045-3-kanchana.p.sridhar@intel.com> X-Rspamd-Queue-Id: E883D40014 X-Stat-Signature: cn1hnhsa9hpfnoy8w8wukxehoh8h9b5a X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1739682643-420408 X-HE-Meta: U2FsdGVkX19bzey1fntg/3X4pY3BwcH9qglgrB8Jp2IDnS4dbJ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kU2wslI2ukPOtX4KjW5wXdOMB/5ZP2T1zocXRxs2uVy+mgSw4jZxy87xJ/f7TK+usID66ljk5aljdZH5feHIrof2E8+ljHCL3P/WudvhcWS1DDCKn1EOsnTCh8zOKZbO19RAauGOU6jiaEHBFkAjg2kqebz8hD6ZJqKeYDAo53wh/jviwbwY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Feb 05, 2025 at 11:20:48PM -0800, Kanchana P Sridhar wrote: > This commit adds get_batch_size(), batch_compress() and batch_decompress() > interfaces to: > > struct acomp_alg > struct crypto_acomp > > A crypto_acomp compression algorithm that supports batching of compressions > and decompressions must provide implementations for these API. > > A new helper function acomp_has_async_batching() can be invoked to query if > a crypto_acomp has registered these batching interfaces. > > A higher level module like zswap can call acomp_has_async_batching() to > detect if the compressor supports batching, and if so, it can call > the new crypto_acomp_batch_size() to detect the maximum batch-size > supported by the compressor. Based on this, zswap can use the minimum of > any zswap-specific upper limits for batch-size and the compressor's max > batch-size, to allocate batching resources. > > This allows the iaa_crypto Intel IAA driver to register implementations for > the get_batch_size(), batch_compress() and batch_decompress() acomp_alg > interfaces, that can subsequently be invoked from the kernel zswap/zram > modules to compress/decompress pages in parallel in the IAA hardware > accelerator to improve swapout/swapin performance through these newly added > corresponding crypto_acomp API: > > crypto_acomp_batch_size() > crypto_acomp_batch_compress() > crypto_acomp_batch_decompress() > > Signed-off-by: Kanchana P Sridhar > --- > crypto/acompress.c | 3 + > include/crypto/acompress.h | 111 ++++++++++++++++++++++++++++ > include/crypto/internal/acompress.h | 19 +++++ > 3 files changed, 133 insertions(+) Please get rid of these batch interfaces. The whole point of request chaining is to remove the distinction between batching and normal requests. IOW, if a request is chained then it is automatically processed as a batch. If it's a singleton then normal processing will occur. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt