From patchwork Thu May 23 02:36:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13671224 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 E33ADC25B78 for ; Thu, 23 May 2024 02:37:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 761386B007B; Wed, 22 May 2024 22:37:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C17D6B0099; Wed, 22 May 2024 22:37:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B0D16B009A; Wed, 22 May 2024 22:37:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3F5D06B007B for ; Wed, 22 May 2024 22:37:03 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B3073140157 for ; Thu, 23 May 2024 02:37:02 +0000 (UTC) X-FDA: 82148098284.05.FC28B15 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by imf12.hostedemail.com (Postfix) with ESMTP id 2094640013 for ; Thu, 23 May 2024 02:36:59 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=FGrfBGOk; spf=pass (imf12.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.100 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=1716431821; 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=JVChZ69GThIydiZ/f0r5OTM5qoAa0M96sdBUhghMrlc=; b=4NA0dTtCFzXLUj0jMexZzjTKgnGgf33j4Gg+evR/mt1YWdxAOxHc/WBm0mzjyaU20Isj3C oy9oAbP6WFlrIAZWDYmtTE6//Ax4FrvMtFBuFYmRIXMDqkCsL7A3LJxCfTI4S110NOQQQq A1hzSxztMw+wwMsXYHH17oZEG3OkdLI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=FGrfBGOk; spf=pass (imf12.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.100 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=1716431821; a=rsa-sha256; cv=none; b=S9kTlG/hN/5GFUTLCrI0wZ9WuXy/1u45RcYa9/GQoU1GPRkd+ytngZJ2KU/H4dU7uB4uOb pSzDW2QF1IRl8jPWtHCfFu1DHkpxj4O9OM2wCNGi5kJNPJha8pu22erkm5JmiutbasceHy wqyn3Eo+TQEhyPCXwVjGW3XG94JX1ys= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1716431816; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=JVChZ69GThIydiZ/f0r5OTM5qoAa0M96sdBUhghMrlc=; b=FGrfBGOkrIMepZ66ZzvKM8u4BOWq8cVqGdmvaVYd4zkoY/rc8yZzeUGuDpMzbYweMTSDhuG/LIc9uGR/xInuf4igP/etqiGPnY9/8rl1dzWltCSiZLnoU3HFMdtfhMzmwy8VqntG/N1E8CErcnbo8OJFbspvu0DChEKertZ+Y08= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R341e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045046011;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0W715RNx_1716431814; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W715RNx_1716431814) by smtp.aliyun-inc.com; Thu, 23 May 2024 10:36:55 +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, ioworker0@gmail.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] mm: drop the 'anon_' prefix for swap-out mTHP counters Date: Thu, 23 May 2024 10:36:39 +0800 Message-Id: <7a8989c13299920d7589007a30065c3e2c19f0e0.1716431702.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: 2094640013 X-Stat-Signature: q6rxa5m51kh4o6gcqmfyp5fwmqay4a84 X-Rspam-User: X-HE-Tag: 1716431819-779856 X-HE-Meta: U2FsdGVkX1/46JO9bAndnveBLIvedsBFCAyYaRmjFLYoE7OsJ573fWVoVQfw6dzvgd/Ojp4VtxwhQ/f0XPuAA+bT++2pLE63GsGWeXKwvxB+VEynVlsXqZkDMMOH6ZxwnEaEiL55Gimq/buiq9NQ1/GUldOaZ0kVqKEDeLMqIV0Weg3bJHQGq3+gqWyg0rdDAxxSi4GWmXnH/wwXucgpqIf3jX1YfaO+fGB5HDfPEIL70x44dUhN2O1wyRammYEhbh5hjVqrHZwcq7wv/QK5Gswwo4kaTaoso6z25dR/4ZeydXc8S7iEoabnces/08zxDH6tVRodTq5zjYMmEc2GhdFI3qbnUfl/CaeBMHR8L9oymh2+TG/3q9jLrj2RuzlE+w5ltYC2BSvEqORW5ZUDEeX7KPZGXesZO5wz1QqJsRwLiOtbPTfa3mZXMOG8JfeB2IlNUTAgEumk8E5NyjwPgeysJdPZLJ4MdgHMtxHB+yM+zZ/gC7v2Mr3TgeFs/fajL9EKiKyWvOwMlgikMrvHgZtUfjnhUHNNw6nuL4s7GKUCLuM0SEevA+qgivZ10JnQbPGmZLt5yFvEzl7RoMSJjg4BqrzJcNviE4cJG02Te3folwSLQ1Sc9+e6EsJI2cwxjwPv8yTX8P22o4llCH3KRCw/72Bm9S0f8i1nak5ZEfXrl4I1qO1DNEAT124veRbu0ZA5kLH4RdNv5zIp+otBR21NjySRRBmSiGmjAIE48cM0xtyPOzsN0pH/+1KvHZNm5IbNLJc4Nh80Pgne4UgXee0iYYoyfmiV8aPcyUZSmR6tofGbQ1EOFYjTBnirct1v5L1AetWG7ef2IhiBqliBlD4BAJKWCRpxOxU9geSnHnMraJ+O5Awnw4evsKe+iYmhiqP6bnXbu75CwmpLToVw3ExkqYDOM/PWa4d7glcPs4YmWhPuKXaSyT6QyTHt8sT7iNmgdkFBOsRl9S9QLa4 5ag== 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 Acked-by: Barry Song --- Hi Andrew, Hope this patch can be merged into kernel 6.10-rc to maintain ABI compatibility. Thanks. Changes from v1: - Update the documentation per Barry Song. --- Documentation/admin-guide/mm/transhuge.rst | 4 ++-- include/linux/huge_mm.h | 4 ++-- mm/huge_memory.c | 8 ++++---- mm/page_io.c | 2 +- mm/vmscan.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index 076443cc10a6..d414d3f5592a 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -467,11 +467,11 @@ anon_fault_fallback_charge instead falls back to using huge pages with lower orders or small pages even though the allocation was successful. -anon_swpout +swpout is incremented every time a huge page is swapped out in one piece without splitting. -anon_swpout_fallback +swpout_fallback is incremented if a huge page has to be split before swapout. Usually because failed to allocate some continuous swap space for the huge page. 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;