From patchwork Wed May 22 08:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13670596 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 2A922C25B77 for ; Wed, 22 May 2024 08:51:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3E736B009A; Wed, 22 May 2024 04:51:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEE7C6B009B; Wed, 22 May 2024 04:51:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A050F6B009E; Wed, 22 May 2024 04:51:41 -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 7FDB66B009A for ; Wed, 22 May 2024 04:51:41 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3F80CA00F1 for ; Wed, 22 May 2024 08:51:41 +0000 (UTC) X-FDA: 82145413602.20.1FB94A2 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by imf16.hostedemail.com (Postfix) with ESMTP id CB03418002A for ; Wed, 22 May 2024 08:51:37 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=Q1Iwr4rK; spf=pass (imf16.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716367899; 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:references:dkim-signature; bh=2ACntvDvoDc3et3+Fy67VpABuhloTFZCY5dsdRNUwpE=; b=B2oKrJ6l0jFd2fVHKSZ/CMu1nrRcP6v1EFajJ3SgWFW8c55zE5nlb15Hh+X2qpxf193VHj eBowx2l3JgNriFo5Zy3sPW0oRDF8EyAkEtQDMiwgKmfy1m4177mGZgOFP9Mom2puq4Cc2N 5wZ1Iga3ElURxj49i8TW6LLCLXWhRbU= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=Q1Iwr4rK; spf=pass (imf16.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716367899; a=rsa-sha256; cv=none; b=IB0vUPcejHd6up2vPDi162PWFCg1e/56696Zsx+ghs/LnLZLUMPvtcqOfQmHaDKsvjemQ0 rC/SeKBaL8ceMuG683lQ8iTyP9aAMfjmhPp0eQzgRKJy29JrdWR3Fcs7Nq3FWjGKffACdP aOSQM6+Bfowy6kCqJv9R2S1+P+YZe9g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1716367894; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=2ACntvDvoDc3et3+Fy67VpABuhloTFZCY5dsdRNUwpE=; b=Q1Iwr4rKTs7TwBWUl+WBgm2r4J+qhmuFw3XXV4FCn6OHrdFLN3YEJL/qyLe8lunhsLiz20QZEoR0HRhwiKpApKmLfYGaeAx6Z2jr3JGW/jVPgztRaBCB6MqAj1bA6d9Z9w4Xldwt/kUEBVuIPBsSAcxY6Vli8TbXSZ1OU4y+tSc= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R941e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032014031;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0W7-qM3v_1716367892; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W7-qM3v_1716367892) by smtp.aliyun-inc.com; Wed, 22 May 2024 16:51:33 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: willy@infradead.org, david@redhat.com, ying.huang@intel.com, 21cnbao@gmail.com, ryan.roberts@arm.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: drop the 'anon_' prefix for swap-out mTHP counters Date: Wed, 22 May 2024 16:51:22 +0800 Message-Id: <0e2a6f232e7579a2e4407ecf075531980d97f286.1716367360.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CB03418002A X-Stat-Signature: o8477zoouu3qdt5uac5g68rsqok149ud X-Rspam-User: X-HE-Tag: 1716367897-767133 X-HE-Meta: U2FsdGVkX18oyA8N1Y8P2QT5mFPk6WiHE+CK20YLvGR+gcSkHKCOGglQ+TnJR3tNz5xD3m4f0xaCp2G25X0BhAWTrcBTQtlTIkX3tcFKXyTB7yDUNHi7moOlEpt6Ql0D2D8BTcVwmoDTegV+48ZAJgQubLsaUEyLEW4G3EN9R/Tv3JyHglOcukELoQWI21vA98MYuf3wCp6S4kilgUC62uBJXLVFRtR5sqkZTHSg+3qsWyUBBaDmjOlXCpMIkKQR/U3Dx3+PdHaN9RCHtFYubP11pNogY0m8mSqu7HER/Z+dI9Wymhotq7JEQEtxfrWEIq5FYHTw2VaSkYkLqnkgzy04oyDkQQokeYs+PFHSF+hmC5cdRUtswwypvIEDVe0+yviRyheSNrECdSlPffZTwHJjp+K85a9wAuJ/N5m2arebWG4VX7K3YFFYY8X9xOO1B6ZmElOxheRWFFlMLaNzcDggx0fbgKyC15vcg+k8GYZk1eXbW0lH6AN3FQO6bWSiL5DR4ZNnJyiJGVWvngvLHEE1akIZrf2vA6aaI/1jXzR73efxyF2/N+c1D3HNXLAPjl7iyBLPzq5T6Sh3EyEcWHML5DKKytHPgAnosMtcr9VlwAFZBesJf+uslkLmudTah7O2WqY/VCid+C4XTSXcG+BKSTVGDaa3bXJDMMozooXFEpwAHcUqmju81p+N4d7WhqV47/JzkZgbBhIh3yjtyKwjTKm2zonoI7GZn8rJuPFKBhh/ZprHHRjnxhXZQLZzSibSZhR3khDl9rznksR8ddIXiZOAuzlOoW+wi2C1qQwXd+BqQRb1Os/UhdNZkhwJXeUG8guNqrtyAGZAN1zIRUZsA0wliSMMbXXP66gJh1NAcRZbLATRODBiW0/Tr+iZTB5Ala4pVlp81JaoOyws/OhjyfNjz5yS4O5kcrnPdJf9ysIm08xoKc/qydvrQqMij0fxhoj76bA= 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: The mTHP swap related counters: 'anon_swpout' and 'anon_swpout_fallback' are confusing with an 'anon_' prefix, since the shmem can swap out non-anonymous pages. So drop the 'anon_' prefix to keep consistent with the old swap counter names. Suggested-by: "Huang, Ying" Signed-off-by: Baolin Wang --- include/linux/huge_mm.h | 4 ++-- mm/huge_memory.c | 8 ++++---- mm/page_io.c | 2 +- mm/vmscan.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index c8d3ec116e29..8c72d3786583 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -269,8 +269,8 @@ enum mthp_stat_item { MTHP_STAT_ANON_FAULT_ALLOC, MTHP_STAT_ANON_FAULT_FALLBACK, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE, - MTHP_STAT_ANON_SWPOUT, - MTHP_STAT_ANON_SWPOUT_FALLBACK, + MTHP_STAT_SWPOUT, + MTHP_STAT_SWPOUT_FALLBACK, __MTHP_STAT_COUNT }; diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 317de2afd371..89932fd0f62e 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -558,15 +558,15 @@ 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(anon_swpout, MTHP_STAT_ANON_SWPOUT); -DEFINE_MTHP_STAT_ATTR(anon_swpout_fallback, MTHP_STAT_ANON_SWPOUT_FALLBACK); +DEFINE_MTHP_STAT_ATTR(swpout, MTHP_STAT_SWPOUT); +DEFINE_MTHP_STAT_ATTR(swpout_fallback, MTHP_STAT_SWPOUT_FALLBACK); static struct attribute *stats_attrs[] = { &anon_fault_alloc_attr.attr, &anon_fault_fallback_attr.attr, &anon_fault_fallback_charge_attr.attr, - &anon_swpout_attr.attr, - &anon_swpout_fallback_attr.attr, + &swpout_attr.attr, + &swpout_fallback_attr.attr, NULL, }; diff --git a/mm/page_io.c b/mm/page_io.c index 46c603dddf04..0a150c240bf4 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -217,7 +217,7 @@ static inline void count_swpout_vm_event(struct folio *folio) count_memcg_folio_events(folio, THP_SWPOUT, 1); count_vm_event(THP_SWPOUT); } - count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT); + count_mthp_stat(folio_order(folio), MTHP_STAT_SWPOUT); #endif count_vm_events(PSWPOUT, folio_nr_pages(folio)); } diff --git a/mm/vmscan.c b/mm/vmscan.c index 6981a71c8ef0..18b796605aa5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1244,7 +1244,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, THP_SWPOUT_FALLBACK, 1); count_vm_event(THP_SWPOUT_FALLBACK); } - count_mthp_stat(order, MTHP_STAT_ANON_SWPOUT_FALLBACK); + count_mthp_stat(order, MTHP_STAT_SWPOUT_FALLBACK); #endif if (!add_to_swap(folio)) goto activate_locked_split;