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 E7DA9C282C5 for ; Sat, 1 Mar 2025 01:12:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58DC46B0085; Fri, 28 Feb 2025 20:12:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5165B6B0088; Fri, 28 Feb 2025 20:12:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DE31280001; Fri, 28 Feb 2025 20:12:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1EB026B0085 for ; Fri, 28 Feb 2025 20:12:48 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C35C0B6C65 for ; Sat, 1 Mar 2025 01:12:47 +0000 (UTC) X-FDA: 83171207574.02.C61F553 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) by imf16.hostedemail.com (Postfix) with ESMTP id C281B180004 for ; Sat, 1 Mar 2025 01:12:45 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=tYwoWpEL; spf=pass (imf16.hostedemail.com: domain of yosry.ahmed@linux.dev designates 95.215.58.170 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740791566; 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=9emaphPqtgVlUZs1vHa3DOC+UUviuIxuArQDUuwWXTo=; b=OQfTKM9m12ej2z4Xwc65XNWhMsPdpRr9tDRvddSItDWbgv6lSwrIXwGr3uJJHjXPWwjHUP 5T2SryST9LdHRD+SNnQRvuYDEgozvpC+Rh34OjzbWEi22sjhx4yJaP30KKKey431ckFCQu HVv/3WB3KysJV69mmmW5tW3G4KTErx4= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=tYwoWpEL; spf=pass (imf16.hostedemail.com: domain of yosry.ahmed@linux.dev designates 95.215.58.170 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740791566; a=rsa-sha256; cv=none; b=UAInHpvDhShg04wfnztM4K9Q62SmhywPvJ/5lGifgnnFO+B0f6yUqmcVXCiA7mbnLMNG9K NqIfK+6DpnbjAVMMBnBFkUhCiSs7ib33JIEI5wLVGtujjePZCBP0ViUDUqjTTBat/Ag0Zh CArJsabkCxBBgVDOiAmdTNGAWG09ue8= Date: Sat, 1 Mar 2025 01:12:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740791563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9emaphPqtgVlUZs1vHa3DOC+UUviuIxuArQDUuwWXTo=; b=tYwoWpELCKiTn56c9jkg+U88rsHhU6tmFfQdFhePgLwATY+0y3h1xuwK9lV99YnXrmAWL8 GUnVbyaprLgv/kHHyBR3MZAJErOYLvWJfLLEi0zCFfUTreqvNos02zhxc+Mx5z8fuEFS+q APxkkx0/eKVHSwnYMeSG2q+nlSICX7M= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yosry Ahmed To: "Sridhar, Kanchana P" Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "hannes@cmpxchg.org" , "nphamcs@gmail.com" , "chengming.zhou@linux.dev" , "usamaarif642@gmail.com" , "ryan.roberts@arm.com" , "21cnbao@gmail.com" <21cnbao@gmail.com>, "ying.huang@linux.alibaba.com" , "akpm@linux-foundation.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" , "Accardi, Kristen C" , "Feghali, Wajdi K" , "Gopal, Vinodh" Subject: Re: [PATCH v7 00/15] zswap IAA compress batching Message-ID: References: <20250228100024.332528-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Stat-Signature: mynah371akynqb4pktdh9i1b8xahtshk X-Rspamd-Queue-Id: C281B180004 X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1740791565-214574 X-HE-Meta: U2FsdGVkX19aK7VtorFxEDSjw/51UcVyNKzTgtw0SQ9sX78sqsDs8TZzRfb+WGexnMVmoxWKIh6jWvui6gLF5fk0hTMtWPw3iAtYDKSWweh5Ql6BEO4+6QqukZUJHHt7FmnmSNWgJQtwWi4t8M/Q2GWGsMcDB3a7W8Mzh5H6Hvv592Nw6WCFFLfJ8UbV0kIKtVAYZIDs2bpGf8nDJXSg83TEYd02JUjoQEOFB1mXE2FI9zbWKkGFpfv+sT0hsUfE4F3NBuqKT4FL+r5geKb9B9/NEX+cEkfqWFXve9A+lKfZrbtiXuqrJCCjMfE6mIJ8OQrz3G6XNXaRlc5pfL7nt+9JUfb2b416na8OGU7vOXKizIatXFVXMAIrsf8Wg2SBLyTWpQlcFdUQbdDAsfIxeDeEudKD0HX9kO0t3fhlVrizZiZdOQUtqbDhSqgBX+aUnlcH/KMk4mRqv1oaIaM/LPRXBT4bve89Hw9pZ6wRYug6XMvg8EsLoJL5IA7t/PAS9rqosCU/umwE5s9z/BiHjxICUwNSQwVaPhjXQB3iE5cDlbcvdVmrdvyDjfALbS+SLTOJFxLmqjFJ4YXphhhUuWGaJ1o92k6GkszJvlN0crqX2wPIU4dSUIDFNQ9uvZJ5byc62PBsMk4aETPGMR23kp6yYCze84ATaHYVkydRT18+h9djnnpiPMXMoJFROCJ41Riv8+gJDZe3kdyFQxhKcZ6erSmutxEMGoBgI8ORyCg24rpIU758hr/OKwIhXtG/kEqJbQ3PxLaAm3SQC7s2cidWui8jJ6HU6Fl8xONyITsTFZo+nWgOfWPobHYuMkAI9uEzHeIEdq53+EEOEXYSl99CFVfKanQOTPR8biC59Ko8iQcEDuodSzvxkpVmmNeoiCua6hMzqJbJ4bNmbJQqQ1BDKT9RL5augx2R+BHnWU5Nd2+vavzTlojdpp5+bAaEu7qy5/fE1xT2PLKQjtd ri/EDbTj NHI5GiR75iVQMz2G+7p7ACBujZhnYDUOtyhqNHeGCghd/jXhNKTuCEuvDJtvQ8VZWP94ubMKliJssgsVUfJvKvjmIC6o+iPncug1SVSsLvxdZwbtDsi+U8n/4KCFV3SQ7ANAW4eTp949kuiiwg/px/ag5fNSjrZDViIINBABlR/gnzSdnW3CNwH1vjD4iEjmQ5F6i2LcOj10q5JvzrQ53ctt5p9gl8jNl++SqtX4QLs7Nw8jCWT4F05mBjwArTm26Y+OS 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 Sat, Mar 01, 2025 at 01:09:22AM +0000, Sridhar, Kanchana P wrote: > Hi All, > > > Performance testing (Kernel compilation, allmodconfig): > > ======================================================= > > > > The experiments with kernel compilation test, 32 threads, in tmpfs use the > > "allmodconfig" that takes ~12 minutes, and has considerable swapout/swapin > > activity. The cgroup's memory.max is set to 2G. > > > > > > 64K folios: Kernel compilation/allmodconfig: > > ============================================ > > > > ------------------------------------------------------------------------------- > > mm-unstable v7 mm-unstable v7 > > ------------------------------------------------------------------------------- > > zswap compressor deflate-iaa deflate-iaa zstd zstd > > ------------------------------------------------------------------------------- > > real_sec 775.83 765.90 769.39 772.63 > > user_sec 15,659.10 15,659.14 15,666.28 15,665.98 > > sys_sec 4,209.69 4,040.44 5,277.86 5,358.61 > > ------------------------------------------------------------------------------- > > Max_Res_Set_Size_KB 1,871,116 1,874,128 1,873,200 1,873,488 > > ------------------------------------------------------------------------------- > > memcg_high 0 0 0 0 > > memcg_swap_fail 0 0 0 0 > > zswpout 107,305,181 106,985,511 86,621,912 89,355,274 > > zswpin 32,418,991 32,184,517 25,337,514 26,522,042 > > pswpout 272 80 94 16 > > pswpin 274 69 54 16 > > thp_swpout 0 0 0 0 > > thp_swpout_fallback 0 0 0 0 > > 64kB_swpout_fallback 494 0 0 0 > > pgmajfault 34,577,545 34,333,290 26,892,991 28,132,682 > > ZSWPOUT-64kB 3,498,796 3,460,751 2,737,544 2,823,211 > > SWPOUT-64kB 17 4 4 1 > > ------------------------------------------------------------------------------- > > > > [...] > > > > Summary: > > ======== > > The performance testing data with usemem 30 processes and kernel > > compilation test show 61%-73% throughput gains and 27%-37% sys time > > reduction (usemem30) and 4% sys time reduction (kernel compilation) with > > zswap_store() large folios using IAA compress batching as compared to > > IAA sequential. There is no performance regression for zstd/usemem30 and a > > slight 1.5% sys time zstd regression with kernel compilation allmod > > config. > > I think I know why kernel_compilation with zstd shows a regression whereas > usemem30 does not. It is because I lock/unlock the acomp_ctx mutex once > per folio. This can cause decomp jobs to wait for the mutex, which can cause > more compressions, and this repeats. kernel_compilation has 25M+ decomps > with zstd, whereas usemem30 has practically no decomps, but is > compression-intensive, because of which it benefits the once-per-folio lock > acquire/release. > > I am testing a fix where I return zswap_compress() to do the mutex lock/unlock, > and expect to post v8 by end of the day. I would appreciate it if you can hold off > on reviewing only the zswap patches [14, 15] in my v7 and instead review the v8 > versions of these two patches. I was planning to take a look at v7 next week, so take your time, no rush to post it on a Friday afternoon. Anyway, thanks for the heads up, I appreciate you trying to save everyone's time.