Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp569641lqp; Wed, 12 Jun 2024 09:35:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+93CMs9UDlBWrkYCS0NMG6BZJcbd66xE6/39xqJIMTp68gMmlcRNJ3uMQSVhvVL4aZFQjn//lUnzexKAjDHKwXVsiBXstbDpGjYAuxA== X-Google-Smtp-Source: AGHT+IGlx/ml97OMWzmfsYXo0UpdeBtd95g0cAYlA6PQ18Po2xk+2hZJVVD40BcsIMd3S3W4lTSF X-Received: by 2002:a9d:7388:0:b0:6f9:ce8e:5dab with SMTP id 46e09a7af769-6fa1c21c6e7mr2503435a34.27.1718210105752; Wed, 12 Jun 2024 09:35:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718210105; cv=pass; d=google.com; s=arc-20160816; b=Zu38ESr8iUQP0JQRzZvNcg2ln0keQLdGEChNeFQyvSoVfw0c5lwIyfDZZZ2n9wKBGC AMSfFQN075H/3yQjN0VXlMDT1NPrYlt6pJhbpxr9WfQ84HGvWY19NzDmv1McpfClIw3e d0eDHu7s1VaAwXGLWAFQe3d9Ms2frCUErCwgnCbFppHchuBBu7JmsUPseolVF875ojif gnfFygsrlpdkYavAVDlSFAAnhYT8YSSMLPnDip1QuNVtwY33QOCE5dhYxwN1nz7ItCjO JXFwmxYW+nMAmWfAJjemAHZMQ27kX9yVvbgdP6NP5x0wj7lsjx3Zp1JX14QUs0ZxTWXl caxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=EtSsz+KOnqb1J9OrnqyEU8J0Ssy5VLPANqhbhuShfVo=; fh=2Jkn5W3wZF75O5PQckipbVC/eZTQLf84dfEFkCwDsQM=; b=e7ow4R1tR/h4vjrNQlr5O1M2l26q54aYPEYXNP0nl1E/czdB0Jb7VTFMrdboz8ILQn yaGfLzlygjidP7Y4SVzI2nQrdW52854t2vW0c0fW9lRioMPihUefrWWLasaQ7IRAx9FW 3Q0mDwiJge4a84pr6BpMaZ5arS0ZGBuOyB3Tpoc2a8rHKQ+qwVWhV+gd+lD6UljqaJVD Y1z6R4SC54mmvHv3WaMsaz2OltPKxZRb3DoNZTTHDTaRl+5RYpUGoU814JyI9CAD56Sv zT70hVZ1T3XYE+BZ6ajTrwXKzBa6ApPCCRjbv6/KhVlOgp5oa5qVzWR0wCp/y62tEEcM aPmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VNkfpfZq; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211921-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-79559bb69d9si998798585a.331.2024.06.12.09.35.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 09:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211921-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VNkfpfZq; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211921-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6F0721C21ED4 for ; Wed, 12 Jun 2024 16:35:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C37718132D; Wed, 12 Jun 2024 16:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VNkfpfZq" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 C55D6181306 for ; Wed, 12 Jun 2024 16:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718210091; cv=none; b=uZI7IuuNLLQ6nwAqV0arRp+yIs+h7IQBuqzlas+ZGOpxQvyb1kWjWy7qRVzL57Kc4ZE2tRNmVKjSNskhESLuXCKyOttA7jHArn0o1u6tA739Tu+55e7wA/7Te2ZizleDJYIoVwLr5X1GibidQIwlGfMP9JLn87M3dqA5t8GZ/k4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718210091; c=relaxed/simple; bh=xz2aYF7s/vSmUzBNAYwC6WNY9Tg2z5UGrhYhKernEZE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=B5gXiS/zbqjSwu+L8UgIK+dIM1xThYf73re3d8gm35h9urYByAhrnw/Heb4Yv2BSHJuDbasbo9bHkiIjqOSQeUq2Wswx2CpZw3ynOQwCHRrZDDBj0jaY3BoIM+FYFgl4DI6leGSd94EoeH5SV36m6DJt4facXgUShxknsBLEX4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VNkfpfZq; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-57c72d6d5f3so5643064a12.1 for ; Wed, 12 Jun 2024 09:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718210088; x=1718814888; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EtSsz+KOnqb1J9OrnqyEU8J0Ssy5VLPANqhbhuShfVo=; b=VNkfpfZqwl23H5PVjxe4N4NMieThuUCIifYys1W4tFieS9yZ/M9N6AUyX9q7UM5xxw eqTANJRKCgkHFrgBr5+Mi7uePXYKDQKnboxIakbjAffJogTrGFC5JzXsoM0F5co2s9Od 3zB/NZ8uG32yP0vKeFfX3EExJrNL6DQjEHVsWitpmcSNQmdChh59d4SAP+iX1wvYsj3n 4QdJ3G5Yx/h2nE2dYC10boqgm3YYnwBY5pCDN8JugYea/JR2VAyBnqC26XevyoWzpxSZ 2Nfo1f46pWmz1p/cTmYgd5hWfdpiax7l/p79ChtwPtF6vFpqDb1/qeH2XrdL3rnkp+HH JAFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718210088; x=1718814888; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EtSsz+KOnqb1J9OrnqyEU8J0Ssy5VLPANqhbhuShfVo=; b=WpXX352rDa6i5schfbNLGrB08fyfYiRRryWW310ACFMG8riJN2ANi4pkHHIJiKjUOO /71aSFJ1nz3C/jrzIoUVh2HX4MBhJWYFsLIQK4GDHIE6pse1EjqwUpivUNiLmViYtw3Z YK6yvlQCglJcllJ2fpv+M6getK/zeLNQF3Pvtf9ZafnMdTyzZr99mjGDbwGthlAAtX5T GDNmMcAOLl4TMCBMxxyDdpR1aYSRFtXzvPx8KbTsh9a5lVxoJPa5tRLnq5mwvzDw088L 1my1s0hAs8fmxxta/eKIO6qQcxJu8f+w1vgAuAYrRkJ61/SmKWd2z/JCLqptkIdJMiiH T0hw== X-Forwarded-Encrypted: i=1; AJvYcCX/DqULgNZUypNRo8EiEP7M/UyC9ejubnWKOhaEgbpLCZK6KeLYP7vu9NT8GdvcHGi/40HdT0yaWxwTYRYekNInnFsaBTxVfGWkR+8/ X-Gm-Message-State: AOJu0YywX90ssLbQ4Y3OK11TIXIILzCaTNTmeSvj8lEIwtBwXLFbeUdS bCUbMU37XkQTaL0knJxEALCC8X6tFLSl0Xek1AFt/OUixBGnxjne X-Received: by 2002:a50:9fc1:0:b0:57c:73a7:da08 with SMTP id 4fb4d7f45d1cf-57ca9762e87mr1461728a12.21.1718210087921; Wed, 12 Jun 2024 09:34:47 -0700 (PDT) Received: from ?IPV6:2a03:83e0:1126:4:eb:d0d0:c7fd:c82c? ([2620:10d:c092:500::4:e76f]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57c7cf18193sm6461175a12.50.2024.06.12.09.34.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jun 2024 09:34:47 -0700 (PDT) Message-ID: <4ed7f644-46c3-4a48-933c-04364c10484f@gmail.com> Date: Wed, 12 Jun 2024 17:34:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/2] mm: remove code to handle same filled pages To: Nhat Pham Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, shakeel.butt@linux.dev, david@redhat.com, ying.huang@intel.com, hughd@google.com, willy@infradead.org, yosryahmed@google.com, chengming.zhou@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20240612124750.2220726-1-usamaarif642@gmail.com> <20240612124750.2220726-3-usamaarif642@gmail.com> Content-Language: en-US From: Usama Arif In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/06/2024 16:09, Nhat Pham wrote: > On Wed, Jun 12, 2024 at 5:47 AM Usama Arif wrote: >> With an earlier commit to handle zero-filled pages in swap directly, >> and with only 1% of the same-filled pages being non-zero, zswap no >> longer needs to handle same-filled pages and can just work on compressed >> pages. >> >> Signed-off-by: Usama Arif >> --- >> mm/zswap.c | 86 +++++------------------------------------------------- >> 1 file changed, 8 insertions(+), 78 deletions(-) >> >> diff --git a/mm/zswap.c b/mm/zswap.c >> index b9b35ef86d9b..ca8df9c99abf 100644 >> --- a/mm/zswap.c >> +++ b/mm/zswap.c >> @@ -44,8 +44,6 @@ >> **********************************/ >> /* The number of compressed pages currently stored in zswap */ >> atomic_t zswap_stored_pages = ATOMIC_INIT(0); >> -/* The number of same-value filled pages currently stored in zswap */ >> -static atomic_t zswap_same_filled_pages = ATOMIC_INIT(0); > Can we re-introduce this counter somewhere? I have found this counter > to be valuable in the past, and would love to keep it. For instance, > in a system where a lot of zero-filled pages are reclaimed, we might > see an increase in swap usage. Having this counter at hands will allow > us to trace the source of the swap usage more easily. I *suppose* you > can do elimination work (check zswap usage, check disk swap usage > somehow - I'm not sure, etc., etc.), but this would be much more > direct and user-friendly. > > Not *entirely* sure where to expose this though. Seems a bit specific > for vmstat. Maybe as a new debugfs directory? > > This doesn't have to be done in this patch (or this series even) - but > please consider this for follow-up work at least :) Yes, would be good to have this . There are 2 things to consider: where to put it in debugfs as you pointed out, and where to decrement it. Decrementing it will require to test and clear instead of clear zeromap at different places, so might be a bit more complicated compared to how zswap_same_filled_pages is tracked. I think best to keep this separate from this series.