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 DCE08C83030 for ; Fri, 4 Jul 2025 04:24:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6276044015F; Fri, 4 Jul 2025 00:23:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D6DC440154; Fri, 4 Jul 2025 00:23:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C6CC44015F; Fri, 4 Jul 2025 00:23:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 362AA440154 for ; Fri, 4 Jul 2025 00:23:41 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id F22C51DA52B for ; Fri, 4 Jul 2025 04:23:40 +0000 (UTC) X-FDA: 83625288600.30.57EE671 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by imf11.hostedemail.com (Postfix) with ESMTP id E165740002 for ; Fri, 4 Jul 2025 04:23:38 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=fGuUWP15; spf=pass (imf11.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751603019; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bFGYTD1XM9QQnUw70r1r8q/jgLTGWuzSmGzSGHYdcto=; b=K0GZd6wKOjTZcj6vxMPbJ6Mx/20R+XqQehU5VK02Gr4ZnPaqN3fHKIT/KVmIYeiVDQ8qtG WpkkctVaOc9bUgXD8IoR9WOoakHCkFB9epi4FcP3+hx27rnWwew2jmtOw/MMXWsWIkw7oV EOW1NWRd7WvDxmkLUbALggzHTkZGoXA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=fGuUWP15; spf=pass (imf11.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751603019; a=rsa-sha256; cv=none; b=veC24L+od74XcUOzPh2UMX014mkyozD/wMU4WQNMZGU1pKMnm82I+DEYbdpPDuEB/QaBp/ K7fkwOMr7hydc3BUjdZIOWmDt3gZmIt7oLZI3jezmU3KnIn32TyivCPAwCH3EaoRSt7vMH HKEJOO+SX3sPfZgje+viwo4u+CDs8K0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1751603019; x=1783139019; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m40pIlIO2wo0gnv2KOAZQPAYTnCzR21fSzFkg8x1DME=; b=fGuUWP15zccDIvHVIZef/EmDyt8L8Y8srBoXFrqhSnalbqZ3FrKaRayt dTVjo/BiFL6XU3Q2qG9zf/FuUKwDFR0U3tsx0j+ApjWVV26A5cL11yIt2 1lP9nJmOKoMmTZgZMBtkfh0CT6Xd1vo71hcbuXpDBLmrZk7sQwWrBJzWQ BJDuDDA0W7lkMqDq7limJFar0q9lwjOt0hlaTXTT23mCHDaxckQSx6dTt k52cFRckbe8DodzDLEZyBGsLwJC5g5WuKFLWDMu9cohNQs646s77NqhjO FIawPA52ooB/fmTdW0y7YhIKCxUWqSnInnt3b5+JdAGhrHw8q34GqWybJ w==; X-CSE-ConnectionGUID: O8tbuNC2QEaBsxelXbpqLA== X-CSE-MsgGUID: mI0pM/FLScebcKBefOG4aw== X-IronPort-AV: E=McAfee;i="6800,10657,11483"; a="53909128" X-IronPort-AV: E=Sophos;i="6.16,286,1744095600"; d="scan'208";a="53909128" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2025 21:23:26 -0700 X-CSE-ConnectionGUID: +Lpl7NRDQSitRqHUpZZD0Q== X-CSE-MsgGUID: xCWoZqZbQGCGzDo8ZVm1RA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,286,1744095600"; d="scan'208";a="153968702" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.115]) by orviesa006.jf.intel.com with ESMTP; 03 Jul 2025 21:23:26 -0700 From: Kanchana P Sridhar To: 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, ying.huang@linux.alibaba.com, akpm@linux-foundation.org, senozhatsky@chromium.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, clabbe@baylibre.com, ardb@kernel.org, ebiggers@google.com, surenb@google.com, kristen.c.accardi@intel.com, vinicius.gomes@intel.com Cc: wajdi.k.feghali@intel.com, vinodh.gopal@intel.com, kanchana.p.sridhar@intel.com Subject: [PATCH v10 14/25] crypto: iaa - Enable async mode and make it the default. Date: Thu, 3 Jul 2025 21:23:12 -0700 Message-Id: <20250704042323.10318-15-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20250704042323.10318-1-kanchana.p.sridhar@intel.com> References: <20250704042323.10318-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: brrwmyc6tonk3ikzku76mrkrdszsza8x X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E165740002 X-HE-Tag: 1751603018-227863 X-HE-Meta: U2FsdGVkX188jilnFrRVrJj5rKp1i4SKlmUDbC8Su4cVOcEEoJLLhdsU+IdTeLGkBjv5wkhdJHiSkP7QpoU7KLgfEms7QuTUd4kNbLi3dfjnnxOuGXg0MGiW3tdbxLP8h3fXi9AlvWwdAuRDoFsqvJuT+CVvKKhd7fLntXxFq6Dhl9fkFIy63ct3yugc7WEUkXSoNMOLCZlgaNk09RSeqyFpIblNNIrsLaYedCSqIxo0fGrCF/N1IgRMwHm5j5ZZIdTAxCmS3+XPjqKMhcD7ZAbfh9cggnYBKwkyB5WS7L81kuHz5yG23fb74vCqNn1+ZmUsM7IrxnaJoqfweMwCczOcKZ6bG36ltxTy9PJOGYhQNvhe9bJEbeZDSFI2d6B6Y9mEgVW6j8VqHZbrdenuucgl5gs9TFJrEdBRg4/rG0EC+rR/NeFmF1Fydfwz9+iGhH+U762MiU3ZeXLUgD+xvPxKzQHHke1GbabUF7cThrkp6qmQ+4ApoBsS+APgiHF71kBwIwIscKQRh/Op531G1u9h4PTc2TXYZjUIhec6V+yjDALH/BUwmRrtiMvTCCCFlocYarhsEZuSTFVWWUaVYeYl2SpM0qiwqMnrC4feYO61Fp/TW6yoolovkqQcgPXXUiEVprbyhVAPc2/IA14sq2uuaIyjPRiIeVQOqhC0PzxbWgUWZQezM8xQf8qtUh54BFSIrMwYjNGPWocYnvRaO4WBMr3ZDMlRscEI4aLaaut8n5rMAQtePGZ4/kgmen0engcKVeGl0sjsDiCvQ9lK4B7XPZXkFb4PeRM7zqDoFOQejKgSpkHDZZ6nLn0NdhgWvoGpBiwsqTh4flyPidrra7WHWCHeflYIXA8i6LPOhQY+j08OiJhxaXiQQFtvSr/JKhlhvT31nsHwYctxQkXgyHayDkY/TYSBOQbiIFPZpWWPU4E+h7MUIKmbgI2EtAtlqV9MCremDfkJV+DitUE Ywxwt6bT 6zL8LmhtJolwwRbMOY/Pw3ZF4QlIh1+FbSDUi6tECw8Wj4ML0ithaARvEpO+CQWjxm+TFp7g63MzSLmpjkSqGKlov3jzTLwGFzFqrl5e0H4BOdaqXcIoSCVtHwbB+SQSjQqfI15vw9+A5A9PqZTBD5dtU8GR7kM/FFTrSWGH0JsFaOr0X6ng9mqmVnw== 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: This patch enables the 'async' sync_mode in the driver. Further, it sets the default sync_mode to 'async', which makes it easier for IAA hardware acceleration in the iaa_crypto driver to be loaded by default in the most efficient/recommended 'async' mode for parallel compressions/decompressions, namely, asynchronous submission of descriptors, followed by polling for job completions. Earlier, the "sync" mode used to be the default. The iaa_crypto driver documentation has been updated with these changes. This way, anyone who wants to use IAA for zswap/zram can do so after building the kernel, and without having to go through these steps to use async mode: 1) disable all the IAA device/wq bindings that happen at boot time 2) rmmod iaa_crypto 3) modprobe iaa_crypto 4) echo async > /sys/bus/dsa/drivers/crypto/sync_mode 5) re-run initialization of the IAA devices and wqs Signed-off-by: Kanchana P Sridhar --- Documentation/driver-api/crypto/iaa/iaa-crypto.rst | 11 ++--------- drivers/crypto/intel/iaa/iaa_crypto_main.c | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Documentation/driver-api/crypto/iaa/iaa-crypto.rst b/Documentation/driver-api/crypto/iaa/iaa-crypto.rst index 949bfa1ef6245..8e0e98d509720 100644 --- a/Documentation/driver-api/crypto/iaa/iaa-crypto.rst +++ b/Documentation/driver-api/crypto/iaa/iaa-crypto.rst @@ -272,7 +272,7 @@ The available attributes are: echo async_irq > /sys/bus/dsa/drivers/crypto/sync_mode Async mode without interrupts (caller must poll) can be enabled by - writing 'async' to it (please see Caveat):: + writing 'async' to it:: echo async > /sys/bus/dsa/drivers/crypto/sync_mode @@ -281,14 +281,7 @@ The available attributes are: echo sync > /sys/bus/dsa/drivers/crypto/sync_mode - The default mode is 'sync'. - - Caveat: since the only mechanism that iaa_crypto currently implements - for async polling without interrupts is via the 'sync' mode as - described earlier, writing 'async' to - '/sys/bus/dsa/drivers/crypto/sync_mode' will internally enable the - 'sync' mode. This is to ensure correct iaa_crypto behavior until true - async polling without interrupts is enabled in iaa_crypto. + The default mode is 'async'. - g_comp_wqs_per_iaa diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index 0ed3d6e8ad0ec..cf12257f7400d 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -152,7 +152,7 @@ static bool iaa_verify_compress = true; */ /* Use async mode */ -static bool async_mode; +static bool async_mode = true; /* Use interrupts */ static bool use_irq; @@ -206,7 +206,7 @@ static int set_iaa_sync_mode(const char *name) async_mode = false; use_irq = false; } else if (sysfs_streq(name, "async")) { - async_mode = false; + async_mode = true; use_irq = false; } else if (sysfs_streq(name, "async_irq")) { async_mode = true; -- 2.27.0