Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp939172rdb; Fri, 2 Feb 2024 08:26:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1QBKwxqy48Ctr1UTMp8FtwABaC5BQcPxtmKyBHflPultBdhZZEh7yHiSq2W+v5tOUUcPV X-Received: by 2002:a05:651c:169a:b0:2d0:4935:2f5d with SMTP id bd26-20020a05651c169a00b002d049352f5dmr1618998ljb.21.1706891218464; Fri, 02 Feb 2024 08:26:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706891218; cv=pass; d=google.com; s=arc-20160816; b=gxCpWhrbzw4h7KRYJfYxPHsF05cnnVGdyhhTSu9yMdiDUpqCCw9VHVnpKGkJguJ/qJ +sMFySAemVMD3TGX2G6aEwb8khSSfQkq6iGGGDlMn6bV3RrWDoiuvVuz2wGKUoe49RLE ploFXb3i9WMVH+tzuThCmctJJsoQzP5AaFk9MuaQKckYxZG+K/qNNPEbVgU3vI6qUEc1 /Y+ITKTm55xuVqdCyZ/Z3/yLqQBlVWPnwgUOvgUfn4ihsDGpXd3C+lcuEVNAyMYjWbdO VOqRIQnmmy/EQjHn3OAuuf0F6qXDo/PAv1Q30gxO19UzKjkUzICHtfEDEdISvRlS23Oj yYUA== 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:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qUtud9MaY+8DbGFxC/AgiltFpITZmSHoCy6Sbv7PuJc=; fh=FQNF1p3dCKMi7s7J83ctE3poL8MnlQgjrK4c94VtFTg=; b=DFU8+vJXlcBuyW+e1qu23Ib6EPjpDqlBbvg1x2rqfZ3ECrOYaQMJ/QM0tgt+7Kqk7H Aj4TXaq1Sf6z0zhEvH9geq42a1wCgkPNNYq2P5GGvUwhH0OLtonNFIqDPc1tmOqFqnYV WOEYc9wh6+Drq2bC1qqZUZjn4fg2pzwcyX2Fnwgyvgi1kKSCEqMuvLvsiHLwZJtPmOzv VFNrUskavOU0nSXCfLqFh+YEKCC6S+Dp7x0qWp+TUVo5AFGEMod2X+lENM6pKqvK66d4 ZZ4jMdGeXv3Wk+4XVoofJrMLZZ+joi/Qr9iuRo2VPjPhyZcSu2FbMqI/1uEoO6tllsn4 BVAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=v33ULgmk; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-50131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org X-Forwarded-Encrypted: i=1; AJvYcCXKlohMfw1aZZ1FZ1jVfq3hyF9HSS7Myxh6Hx59Ymgby4PfQtjeYUglEBBasWn5rjebVFeny0Fqda5PfiSqTRmr/PRLjjROjEzFH/upmQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p24-20020aa7d318000000b0055f35fe53dasi960379edq.137.2024.02.02.08.26.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:26:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50131-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; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=v33ULgmk; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-50131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org 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 5FBAE1F27B61 for ; Fri, 2 Feb 2024 16:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35AD41474D2; Fri, 2 Feb 2024 16:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="v33ULgmk" Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0EE51468FF for ; Fri, 2 Feb 2024 16:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891201; cv=none; b=snZmgR7e9iGvMcr1Rf0WdzNEEZ1XShjPHB+5KuC4lWm8vYSsANIyiKoNsHIDLuLfraFCETGd8OHKaJFwmUIr+oS4dHq2cz49fm6GK7wqTVexR3Armf6vvbwVE2oFiHA1kt6D+v0Fvj3IuHnDXtNJcAOabzaMBaBhbTTv0ZRwrlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891201; c=relaxed/simple; bh=YjQN028awgvU7iwus9yS0iiqFqbGMgbr0N4Uc2tkmyA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i4iIph2x4TzVLg5fr6C72dU96g1xx4VnKUPt/YUAODBHy8mnp242ZZ8x53z0CzHEET0177hPWaDdu33jhl34a/J0Ye/HVHfxJdMKlTIZ5XUct5YD+h8wiQ/KGzTwTN9TUbJwYLJ+FZtBmT9bikDDwrNJKSHTAotZjZU2gf8l0rw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=v33ULgmk; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-68c7a26a5cbso7870906d6.1 for ; Fri, 02 Feb 2024 08:26:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1706891196; x=1707495996; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qUtud9MaY+8DbGFxC/AgiltFpITZmSHoCy6Sbv7PuJc=; b=v33ULgmkUuytML+3TiJy+Ev9t3BjXD8lwYKZy1WwjsS8zVRs+I7Gj0gGEpjLsZ6E+w 2ZIgjqYO6AX/Y7ScoF3BbT186EmKW+JSBkuXin+eJCk6f/GJWAJY92d/n+fB8zX213ql DV0g3k4CRhI13W9i8XGZ049+6CSR2ptG0pa9U/j9DbMSDLh0ICX9dBIzKdLaYK6NP8YR YG6yQJw2NarT7ZMRxdxp/V0mn2w5sOOZQ6bITHwZ8ON2ltj8Eg/bDHtZeSuLRdi90WlQ DC2TiDH2xkIFrOl4bbIkTHKImX0+ejonXwiQmIhN98PAUl86jdoehf002n090CnOMAGE InIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706891196; x=1707495996; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qUtud9MaY+8DbGFxC/AgiltFpITZmSHoCy6Sbv7PuJc=; b=wPG+zhAOsud4mtHmZU5XALzB1y3UNCH6HVe42Ey5oLzUTNJ1z4M/I00mWzOf+9OzKR FHAbF4XUSQoSHdJLv2jJCLL0Ko9lrfmQp+KJm24NNp/O8LNYqXe4nU/3l+E6cmed7LyD 9Db51FV3R7YJ6LMqtJQab20OvfrfnTlvTIg8Vaa9nIwtCG/ANrxYiJpcEVIBn7fNON+p e2airVO/XvdnGMIRPWVZnLtf3VFg/h6PDNRlIJZup/En293FL6sEMVJ5BOCyvwLocY91 vkmLDqypdT9OAie0nYrc/cLxBLSlY+90fmQeCHK2+Ng7GyQhiehWCf3zsddEYXXF7BcC YR6w== X-Gm-Message-State: AOJu0YwPC55QUqJ2UDOBWjpS/IlBxvchpSlW3kyHJnGeBHg2RIBAAoiJ XZHhlbe7F4Q1VUpy9Iu10Czx3OQNSim7XWY8JKU6Dh23Vo345wrfOWBL7NBvzfQ= X-Received: by 2002:a05:6214:1249:b0:68c:83fb:b612 with SMTP id r9-20020a056214124900b0068c83fbb612mr3698583qvv.31.1706891196695; Fri, 02 Feb 2024 08:26:36 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXLy6eSRRk6gE+pUfspZpC36LSIoz8TKb6OrfiQcB/j535+xtv3G0UK4Jd4hk03HP45prGKixWhBela9dScvtWqZo0JcY7OSJh2l1+ZhzOyGtKU5lEwZKDvwlj+O7EHgg39b82jQloS9S8sBOdhJ40NwoSPwvi58y6q7dOfrynzzEbRifII/TxboaVy60mcfQc4Dg== Received: from localhost (2603-7000-0c01-2716-da5e-d3ff-fee7-26e7.res6.spectrum.com. [2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with ESMTPSA id w11-20020a0cc24b000000b0068c5b3a7f2fsm938734qvh.37.2024.02.02.08.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:26:36 -0800 (PST) Date: Fri, 2 Feb 2024 11:26:35 -0500 From: Johannes Weiner To: Chengming Zhou Cc: Nhat Pham , Andrew Morton , Yosry Ahmed , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 5/6] mm/zswap: only support zswap_exclusive_loads_enabled Message-ID: <20240202162635.GF1227330@cmpxchg.org> References: <20240201-b4-zswap-invalidate-entry-v1-0-56ed496b6e55@bytedance.com> <20240201-b4-zswap-invalidate-entry-v1-5-56ed496b6e55@bytedance.com> <20240201181240.GE321148@cmpxchg.org> Precedence: bulk X-Mailing-List: linux-kernel@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: On Fri, Feb 02, 2024 at 08:57:38PM +0800, Chengming Zhou wrote: > On 2024/2/2 02:12, Johannes Weiner wrote: > > Caching "swapout work" is helpful when the system is thrashing. Then > > recently swapped in pages might get swapped out again very soon. It > > certainly makes sense with conventional swap, because keeping a clean > > copy on the disk saves IO work and doesn't cost any additional memory. > > > > But with zswap, it's different. It saves some compression work on a > > thrashing page. But the act of keeping compressed memory contributes > > to a higher rate of thrashing. And that can cause IO in other places > > like zswap writeback and file memory. > > [...] A/B test kernel building in tmpfs directory, memory.max=2GB. > (zswap writeback enabled and shrinker_enabled, one 50GB swapfile) > > From the below results, exclusive mode has fewer scan and refault. > > zswap-invalidate-entry zswap-invalidate-entry-exclusive > real 63.80 63.01 > user 1063.83 1061.32 > sys 290.31 266.15 > zswap-invalidate-entry zswap-invalidate-entry-exclusive > workingset_refault_anon 2383084.40 1976397.40 > workingset_refault_file 44134.00 45689.40 > workingset_activate_anon 837878.00 728441.20 > workingset_activate_file 4710.00 4085.20 > workingset_restore_anon 732622.60 639428.40 > workingset_restore_file 1007.00 926.80 > workingset_nodereclaim 0.00 0.00 > pgscan 14343003.40 12409570.20 > pgscan_kswapd 0.00 0.00 > pgscan_direct 14343003.40 12409570.20 > pgscan_khugepaged 0.00 0.00 That's perfect. Thanks! Would you mind adding all of the above into the changelog? With that, Acked-by: Johannes Weiner