From patchwork Mon Aug 19 02:16:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sridhar, Kanchana P" X-Patchwork-Id: 13767725 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 BD5A4C5321D for ; Mon, 19 Aug 2024 02:16:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84C676B008A; Sun, 18 Aug 2024 22:16:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C1C56B0093; Sun, 18 Aug 2024 22:16:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 493546B0092; Sun, 18 Aug 2024 22:16:29 -0400 (EDT) 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 23C266B008A for ; Sun, 18 Aug 2024 22:16:29 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A0A51160E96 for ; Mon, 19 Aug 2024 02:16:28 +0000 (UTC) X-FDA: 82467380856.09.8709E19 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by imf18.hostedemail.com (Postfix) with ESMTP id 83F441C001A for ; Mon, 19 Aug 2024 02:16:26 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=DJLFl5sV; spf=pass (imf18.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.9 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=1724033709; 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=uty/QWuHBMaY/uR/NUz+WS/fVkoVt/Cbs3XD4FdGk8k=; b=qL7fxSDMlGi9OTmIDUvpGfDlg3NMz64Tf3g/hSo4X4jQMIvI56Rtw4+yfT0GsM+aGemrn1 gzyN6v5isbKE+71mNmt77mPWrRaW1Zh4ED34iNIJXoDRYs3NTIAiXGbn4O3Y0Fzt9DbwRl fUa02ZN/kZgYt+2qj/DhLXxteRMb5Tw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724033709; a=rsa-sha256; cv=none; b=Xqv13gfhMwGoREYcR6DVW1tumi+BrX/eywlCZH5YNTfrolXbgNKmwDXE6DYSE56jCbaRaR 2BKc8l5mzHXwwdIK4jQqPuJm1Ym5uAgYPjczZ4yguHYagkOEBDlc31AA+B+Kk95XNsfKPa eBerEN1gkZnvBdLo9KKZRNLtpF6RC5w= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=DJLFl5sV; spf=pass (imf18.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.9 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724033787; x=1755569787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pCqID+ibJQzADFduLDZJx6IU2iRBnr8hLVZlnSUbIa4=; b=DJLFl5sVEYLpX2SIVeHhTyfdmZoryX4ggQD2ezfTP2K7RqyEqjj08apw 9pFNUYAsdrvShmuJ5pUimOJ7BPAWxE43E1k71xb0XSKSQrcRG8a3CdPKC fhd5SCtUV3A7j4OgfvUQATlxluqH28eUQdUvUdHiDU4jnMTwEeVSOHi3g dh6zLJGEASnShBmT+SyIlHcHCAtMMtQ+e8oPF0C3bB0IKVu1qUQKVRQPa jzZytlJsHL/lu+ofwpGG6BR1H7LtbUYG4zWOp6IgnT67Egyi8UwbO8mo7 cjATS3pKjd2FJxRb0AV3QzH/4uw/zOfywt+ub5TJ7BLGszHleKRYH8vBe g==; X-CSE-ConnectionGUID: RY4ZVVAgSseK6P/+ccU2Uw== X-CSE-MsgGUID: AP7svo3FQii2vk9tbHnfow== X-IronPort-AV: E=McAfee;i="6700,10204,11168"; a="44782974" X-IronPort-AV: E=Sophos;i="6.10,158,1719903600"; d="scan'208";a="44782974" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2024 19:16:24 -0700 X-CSE-ConnectionGUID: rdbxAd1TSN20Iehf1fk1wQ== X-CSE-MsgGUID: 2WIPODmDRpS0GbvMDmwXxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,158,1719903600"; d="scan'208";a="64610277" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.6]) by fmviesa005.fm.intel.com with ESMTP; 18 Aug 2024 19:16:22 -0700 From: Kanchana P Sridhar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, yosryahmed@google.com, nphamcs@gmail.com, ryan.roberts@arm.com, ying.huang@intel.com, 21cnbao@gmail.com, akpm@linux-foundation.org Cc: nanhai.zou@intel.com, wajdi.k.feghali@intel.com, vinodh.gopal@intel.com, kanchana.p.sridhar@intel.com Subject: [PATCH v4 3/4] mm: Add MTHP_STAT_ZSWPOUT to sysfs per-order mthp stats. Date: Sun, 18 Aug 2024 19:16:20 -0700 Message-Id: <20240819021621.29125-4-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240819021621.29125-1-kanchana.p.sridhar@intel.com> References: <20240819021621.29125-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 X-Stat-Signature: wa5tiniptmutbrod99i6si8csbg1s7af X-Rspamd-Queue-Id: 83F441C001A X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724033786-932794 X-HE-Meta: U2FsdGVkX1/+I3XMbfquJa0bDpTmlL78H5yg+TJ3XXQ0FKBq5sAL/F2hhAvqkTjRIjqImbAB6TgzFAPm6lnQUKwEhI5H3VZ99E+oIbe/VmAUnupG1rZnj7/ThkKoADDg/IlKZAStw0M0qVMdiFPUQqCu+xeSW0gGMXyhAT+oNRnbkcBxcPIakZeg8TRZQXq0/nrdtXtU/413i6LZVO8MfWFN+iZOK/82zHN6cpOuL7fWG93mPm7TTVnZvUctuxgrQfxdCWNw31xmaUp+HHtdakwSdil0THKDdX3b/E7d7KZB0Ff8rkwfTrWyEDwb0Z1mDTtm2DV+LmS2n8Gq3H+CDmYAGRhYxY8V/Hk3mAjsIMDHKRA1yrUxJvasCRKQA17vXTN1XeX9qc5H567HnXo845o8uZLeQ5ckJDI9KVNl1JpX7uQeABeJz1FaD7KXmALLjPtU8iyRLawJkWtiI7DEvdxgGl+LVku8J5WaGELD5nsb5zP22k0OsIuOtDUVYQ5qA+vkcdQJHjB5bl+CpGQ93rlyHSlBECns+/P+gAwnu9W5pPb69nwX2f4rh17MxKYFZnfBN1l/rlXK+aHs5/TudP+iWThUp8h61cshxZz0h7Or/jbZE01AFDSwNUeRX8Kw192h4qCF0rVlM5fK0pp6BSQS+NR6E4NK8WGPIAnGD86Lx3Y5nFjiqIDERYzLwRvUbtErkBOrjtw5KoSEFOoZToH/oucWxYjAqq1QYBKtAx5MHlSiwCVUmc8HQ99e2F5qz2IMiN1WSQqwwMEEVgCkE1BjMjjxslk0rAvtU9s1wSWqOrzYfq+MEfp/CHAM0CYZNsUGWm89GTKmXtB37tbSSSzKVA5ovsh0uBOcTK9hPuLu/IJVeyJTTf3XYkpPgYd3JokAbKZMXRqxyUuHF8DclknWzlNpKutUEuXCrRMjbuiy8PRDEgMtVZiz4cPrAJEVon7Gn3X8dFwRMpk6pH3 pXy3F0aB 9CdBSKnHu3RZChXIPBsNfcmIe440V6KMerqrGEXSDXcIv8JcuYV47FWzWZnPFoyOG0QkK7NCeKe/PAnauVBGP7uE/cv9C9Z4J90iieBTfDqygu1AvOd641PNndSkOIVYqwWD7fs6kKHXftPVw6gCZr1+hnO+V7FfEYU5swv+zVyAHZ67ijdWrniAQHazIyWtPNxtYKsvk4G82rXg= 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: Add a new MTHP_STAT_ZSWPOUT entry to the sysfs mTHP stats so that per-order mTHP folio ZSWAP stores can be accounted. Signed-off-by: Kanchana P Sridhar --- include/linux/huge_mm.h | 1 + mm/huge_memory.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 4c32058cacfe..19d3e26eb276 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -118,6 +118,7 @@ enum mthp_stat_item { MTHP_STAT_ANON_FAULT_ALLOC, MTHP_STAT_ANON_FAULT_FALLBACK, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE, + MTHP_STAT_ZSWPOUT, MTHP_STAT_SWPOUT, MTHP_STAT_SWPOUT_FALLBACK, MTHP_STAT_SHMEM_ALLOC, diff --git a/mm/huge_memory.c b/mm/huge_memory.c index cf8e34f62976..73b8ad255d8b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -587,6 +587,7 @@ static struct kobj_attribute _name##_attr = __ATTR_RO(_name) DEFINE_MTHP_STAT_ATTR(anon_fault_alloc, MTHP_STAT_ANON_FAULT_ALLOC); DEFINE_MTHP_STAT_ATTR(anon_fault_fallback, MTHP_STAT_ANON_FAULT_FALLBACK); DEFINE_MTHP_STAT_ATTR(anon_fault_fallback_charge, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE); +DEFINE_MTHP_STAT_ATTR(zswpout, MTHP_STAT_ZSWPOUT); DEFINE_MTHP_STAT_ATTR(swpout, MTHP_STAT_SWPOUT); DEFINE_MTHP_STAT_ATTR(swpout_fallback, MTHP_STAT_SWPOUT_FALLBACK); #ifdef CONFIG_SHMEM @@ -603,6 +604,7 @@ static struct attribute *anon_stats_attrs[] = { &anon_fault_fallback_attr.attr, &anon_fault_fallback_charge_attr.attr, #ifndef CONFIG_SHMEM + &zswpout_attr.attr, &swpout_attr.attr, &swpout_fallback_attr.attr, #endif @@ -633,6 +635,7 @@ static struct attribute_group file_stats_attr_grp = { static struct attribute *any_stats_attrs[] = { #ifdef CONFIG_SHMEM + &zswpout_attr.attr, &swpout_attr.attr, &swpout_fallback_attr.attr, #endif