From patchwork Fri Aug 16 05:48:04 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: 13765456 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 CAB67C3DA4A for ; Fri, 16 Aug 2024 05:48:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3CCE8D004C; Fri, 16 Aug 2024 01:48:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DC3878D002B; Fri, 16 Aug 2024 01:48:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C16DA8D004C; Fri, 16 Aug 2024 01:48:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9C5708D002B for ; Fri, 16 Aug 2024 01:48:15 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4DFBCC1927 for ; Fri, 16 Aug 2024 05:48:15 +0000 (UTC) X-FDA: 82457028150.21.AB6E4C2 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by imf25.hostedemail.com (Postfix) with ESMTP id 381C1A0002 for ; Fri, 16 Aug 2024 05:48:13 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="BZAQOl/j"; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf25.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.11 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723787238; a=rsa-sha256; cv=none; b=QBvt9xY20Pu2nlMnTa9+S/f47gRzprDFW01YmyQ3cJdxuaddNJCuSPgmixRiobCrUxGeBy fET2qsFiPJn1+AHa0C2QYkwGu7fPyCXGwQAJLyUqEO3GhGRUYggvHsL+xRbRoQzGbkRpZZ 7dJqYzi6xANdOb1c7AsXQD2S4+miLJ8= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="BZAQOl/j"; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf25.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.11 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723787238; 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=lGWbhjtSJVg8G5Ir1pHmR/keo5/N7hZqSr5qDj7PThk=; b=45g/hCRaa1NIJ3DW7fCrOPtvwhy761YDRbaqxIsbTnUss2E8ouwtZsVSY0Uv35ctjyUPD6 +etzghLcAKdeB9NJd6YbOsOdF/rZuKbgWcFWzoQZ7DUMSkCl6WaavUmjyPPeN+IKo8/s2o 5sPw+dZtoYqVqod/jJGSPb/Iwe7qVYc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723787293; x=1755323293; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Rhd+o6cIvQZsonqH5BjtpwXRBNEn4sYl6ZxLr6ObqFU=; b=BZAQOl/jpsch4hFlnyMO3I8g3VSW38tJ2yQ5Q/WUDHOEBuujUskSChdC LugOH/Nu5/yRrPSbr/GlKXvnASClNtTiyADeqpdYViOpI1vG88blfejFA kiKV9CQ2WVA0NDnaKTfmyeG1iTihKWvqzAR9GFpWF3jovjAD4QrK9K8cM SyGM92EqEDR9gC9oQQ6Nyz1Drv3aXg3pn9tAIMevb0teJNzO2F91WDUnd w7foZmnOiQSS8WmgLW6B+txBsDkpL2D254NAwJJZB/aNc9G1f8OTLi8AS j20MvTRa4dzSTDREnZZptYEKsONofvVcs1rVs2nlPJkEO6M0F1KNAKQrl A==; X-CSE-ConnectionGUID: ZYjXHyuTSSqmajzUHwXzcw== X-CSE-MsgGUID: 5Djrwoy1Sw2GUVVIXA8zKg== X-IronPort-AV: E=McAfee;i="6700,10204,11165"; a="32648126" X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; d="scan'208";a="32648126" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2024 22:48:07 -0700 X-CSE-ConnectionGUID: QU3cm6lVSTygm9MQstxIWw== X-CSE-MsgGUID: 2AV6aJjrTpmXJ/AXuljOAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; d="scan'208";a="59415339" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.6]) by orviesa010.jf.intel.com with ESMTP; 15 Aug 2024 22:48:06 -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 v2 3/4] mm: Add MTHP_STAT_ZSWPOUT to sysfs per-order mthp stats. Date: Thu, 15 Aug 2024 22:48:04 -0700 Message-Id: <20240816054805.5201-4-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240816054805.5201-1-kanchana.p.sridhar@intel.com> References: <20240816054805.5201-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 381C1A0002 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 8b77na3nf5h8cotiwjksbmnith3rce6n X-HE-Tag: 1723787293-315992 X-HE-Meta: U2FsdGVkX1+am1ftCHPwzqUl1YFshlbLaMss+6fJfvRXzFfkS+sPCdg/EQCHXrbQ7E0XXiJBJ0FDn44CjOX7F63olgSkbQqyMgM/rfIftmLykp5RpAGBjJc36s/M0hKnjf8CyT1LMHsN4iCEG1+7xIyBh6laSk/Hz5AitKWavG+Lst186wgw9iVEn6o5edI1tjR+IPV8dmy7s5hWhfFV9NFD2I4ZRb/HoAMmw9tQOTQoIcJlKRM4E6vvLr7QnUpF22VHa7cYINs1FlM0ny0G2AmzJkcvm0jmOyDWua5aXxqdS9vMf7DS8eNF6/mG5GOiN5HVcQSP4WktsQwV1TO183WBoZGYRyrzXWSbS6gSMYkVN8RGPVTdX8otQoavPTjuFxeOx8VH1ou7QI7ZWA2cYdXZIqPMq1W0GyA3mf5M8kY9wQrQcFHFD4Z1ijqgGeXbkhx0o+cTs8k/7wBujarBU1wPqU436smPolyQNl2/2YE+lm1mbfvLFwk6jHwrmeTw83TuPtfgSVvv485r1bpnYGXRwHuT08ldkjEax61yEGLIi4NzDnnQMcRRlN31UpofhQYF+zojvQVT0FVLVuwJH7tQe93IJRV6GT2/vYcuR3NRxT9ZvT/UOVwJIESvMmL4XK8f+n4cKfhvYPUyIQMmouJQG2eI+nU/DljYIVuDMXzQd4kR+sTvIiHF2ZbzpLxPil7sOO7ptm9/MfMTTkeG0yhAaXLpYovznj1HZFHFRfr/jcRd7OWduHgZa1cqH8Gmv+BIych89Sw+2bB4YXioF5ZrSRQAXHJq4mLCDi28LqKUAWvm1T39inrc3fi6bz1ZSS/ThSUcqtOCenmBi5Ly8Vqdc8KjyBI0X7FXzuM77P7FpWY+lSN9di4o70rGvdHphzCV6cflsdqqciqtvJmngIYTnS8i00NVqcMtrMC3/pg3Qla/6X9wMPgHwoyRuieZunDCbzSiKWL/c5XAN1b R3MJpi5j XLJraFQ+2ggxEWhl7ZtqIQpnYHLThabWL9f4U7l66++hvqYalo3jQEabb9fb1uHveAu6b1CMnQP+NxLvuWohWYi0G9TWcdh6ifyxWRpEaO7/MqDnvelg/44d5Yq37PY1l4s8AbJ1P5zLtVLFGk2wLmw52+a9wk1yY/hkVKe7agzSRA7YbwDaIG1Q7vrzHz3QAxLEmUKRU7WKCUXY= 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 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index e25d9ebfdf89..44609d84f2dd 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -273,6 +273,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 f4be468e06a4..7e97b6ed6ff1 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -574,6 +574,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); DEFINE_MTHP_STAT_ATTR(shmem_alloc, MTHP_STAT_SHMEM_ALLOC); @@ -587,6 +588,7 @@ static struct attribute *stats_attrs[] = { &anon_fault_alloc_attr.attr, &anon_fault_fallback_attr.attr, &anon_fault_fallback_charge_attr.attr, + &zswpout_attr.attr, &swpout_attr.attr, &swpout_fallback_attr.attr, &shmem_alloc_attr.attr,