From patchwork Tue Dec 5 19:33:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13480681 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 481E3C46CA0 for ; Tue, 5 Dec 2023 19:33:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7BE36B0080; Tue, 5 Dec 2023 14:33:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A2C7D6B0083; Tue, 5 Dec 2023 14:33:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F31F6B0087; Tue, 5 Dec 2023 14:33:12 -0500 (EST) 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 82B2F6B0080 for ; Tue, 5 Dec 2023 14:33:12 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5015EA024F for ; Tue, 5 Dec 2023 19:33:12 +0000 (UTC) X-FDA: 81533763024.29.E879197 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf28.hostedemail.com (Postfix) with ESMTP id 823CDC0009 for ; Tue, 5 Dec 2023 19:33:09 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JXrAXqs6; spf=pass (imf28.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701804789; 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=yzmYrhMAdXLD+///kOQIC9tqV0WlC8PR4PrJXczDCuA=; b=nXXmqcE46VZyPv/+TVR7WLUVudXIHlOkMDJp/42pNNXLYOdD03M9Y6f8zY0TlqenvTPP8m XdfHoTPw4BmqGJD4bLfOj1RS9lGG4ZffmV28sjPkl6WA5axH1fWOG3zboIv0UnerU3mMTq SB3T3LN0wtLJkoAY6g+lstfYHoRX6xU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701804789; a=rsa-sha256; cv=none; b=CQh5C1umF/hCwZJoQxNXYGInSueUdrwAA/a55SEuvYHhT86AmROjpPQBDsvogQ13TSyjXF akMi7Wl11htkRpUETFsmGXoQa65wN95bJPRLQqPQrB6mxJTEiCzjUqZW3yXoN3UPXaaH8A lcYvK+XZgxEUCnoXPl+mP3rPMNeVCkI= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JXrAXqs6; spf=pass (imf28.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6ce6d926f76so83799b3a.1 for ; Tue, 05 Dec 2023 11:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701804788; x=1702409588; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yzmYrhMAdXLD+///kOQIC9tqV0WlC8PR4PrJXczDCuA=; b=JXrAXqs6fqjGLanuF1LKhzUsWfnAUF5NcudMrQkdl1AlhXJ+9F+psQicuQt1WUEl3S BvS+RIOnhm8pVLx7TY0AsQPhEyNERrCU22rNZADeQZw6g7aTCJ94Pl463S5hbOt54X9n IRXaTVGGHLxGv5N9YukxP0nBliYHpW/eoEbkDlySJ4/PNurjss/QX7MvY6fEzbzPxYqW jbRxFpzxNK7kyEOvNBfaEcT6SMP65XdKM0sGFWdgnAV6Ew/Ts5OOOj8vMf0wvuVWFBH4 j4eBZM9Bq5eYfxELR6YGV2j2TLkrWty9QKkid63nFqHEpT16Q3mogx/kyWgf35Fxu7W6 f6ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701804788; x=1702409588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yzmYrhMAdXLD+///kOQIC9tqV0WlC8PR4PrJXczDCuA=; b=GH6xHErEK8ebMnBt3f7W4/2IIRmeIKn6/QW/K8/8rU7LPi57BT72Q0eoDLPfpgscJN m8nKA4WWjeufkO4/UQS+Gm860/QuggebdAgy4xmh1j0y6QNBNqNgN9JH4ij5V/BICFXC rdnMbftEBJ1JesvRH57Ytxk57nmj7vUWVXI20usF6ciSLv2NHboOpouwFMhh5ipHB9QK XgDjXei5SI62acA6tPAf2JJ0beyHYUGXPEXC3ri+1CQ9ZMGK8sOoUEm9Qt6xTuPEG5AD lmQ6H7D81/OTva539CcOiHA/VtwOWd5Vw7Dsw2rPqQIAPFJUJzgmRmeuVt4h8eEZAlzu XoAQ== X-Gm-Message-State: AOJu0Yw0IWdMgS2bN9xb1ZpUoR4IExiTS0bAjQlKMU+W9vfA9pPQbF8o tnVRQ3vhCy0XCnRJH2a+llk= X-Google-Smtp-Source: AGHT+IF9r+jplWi+C3DggSGVvOK4fb3t6NnJTlcHQ8Doyqcaiilw07s+4VOK7eualppViE9dX8+beg== X-Received: by 2002:a05:6a20:da86:b0:18b:cdd5:10c1 with SMTP id iy6-20020a056a20da8600b0018bcdd510c1mr2603327pzb.26.1701804788200; Tue, 05 Dec 2023 11:33:08 -0800 (PST) Received: from localhost (fwdproxy-prn-005.fbsv.net. [2a03:2880:ff:5::face:b00c]) by smtp.gmail.com with ESMTPSA id o9-20020a056a0015c900b006cde4523767sm4612803pfu.22.2023.12.05.11.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 11:33:07 -0800 (PST) From: Nhat Pham To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, cerasuolodomenico@gmail.com, yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, chrisl@kernel.org, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org Subject: [PATCH v8 4/6] mm: memcg: add per-memcg zswap writeback stat (fix) Date: Tue, 5 Dec 2023 11:33:07 -0800 Message-Id: <20231205193307.2432803-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231130194023.4102148-5-nphamcs@gmail.com> References: <20231130194023.4102148-5-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 823CDC0009 X-Rspam-User: X-Stat-Signature: t8m55s1thewgnqz6dee63dp7a1i5cdg8 X-Rspamd-Server: rspam03 X-HE-Tag: 1701804789-514631 X-HE-Meta: U2FsdGVkX19xqLy0tN/00921HtaQZGkJLA1K4lnFyT6FOJ5mESOqaxRUYWvmAajSJ7KdHHiobk/llTKOVRfGu1/elJarqGK7e/pFaABdWpJ91Nn+hM0jlOG/NqaxDD3sRxOyOM4AJzoeWhi/vrY27KN2HaOqDzt1TIEelddt4Pr92SRSVB8UZavo80ZqFLlI/oV0orLx4dxzq1lNpMIW2Cv7GEsd/ux+Ob7aQtukQPw6wUY2nK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f4USilXrsOECDxkK+5h/MH/L5UyM16Vj/D/A7j5RRyTZuPuuLyilCjbUEQE8XA14vBQUXBGv9mr+pH45VY1ZVwFI7tib6hMezk9JfcUZj0Et4YOEwl38+4bl1Otn8v49KI6w10jMLnpf8PKCyiUnUISRFmlBT2SI+lNhjNhi0= 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: Rename ZSWP_WB to ZSWPWB to better match the existing counters naming scheme. Suggested-by: Johannes Weiner Signed-off-by: Nhat Pham Reviewed-by: Yosry Ahmed Acked-by: Chris Li (Google) --- include/linux/vm_event_item.h | 2 +- mm/memcontrol.c | 2 +- mm/vmstat.c | 2 +- mm/zswap.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index f4569ad98edf..747943bc8cc2 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -142,7 +142,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, #ifdef CONFIG_ZSWAP ZSWPIN, ZSWPOUT, - ZSWP_WB, + ZSWPWB, #endif #ifdef CONFIG_X86 DIRECT_MAP_LEVEL2_SPLIT, diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 21d79249c8b4..0286b7d38832 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -703,7 +703,7 @@ static const unsigned int memcg_vm_event_stat[] = { #if defined(CONFIG_MEMCG_KMEM) && defined(CONFIG_ZSWAP) ZSWPIN, ZSWPOUT, - ZSWP_WB, + ZSWPWB, #endif #ifdef CONFIG_TRANSPARENT_HUGEPAGE THP_FAULT_ALLOC, diff --git a/mm/vmstat.c b/mm/vmstat.c index 2249f85e4a87..cfd8d8256f8e 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1401,7 +1401,7 @@ const char * const vmstat_text[] = { #ifdef CONFIG_ZSWAP "zswpin", "zswpout", - "zswp_wb", + "zswpwb", #endif #ifdef CONFIG_X86 "direct_map_level2_splits", diff --git a/mm/zswap.c b/mm/zswap.c index c65b8ccc6b72..0fb0945c0031 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -761,9 +761,9 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o zswap_written_back_pages++; if (entry->objcg) - count_objcg_event(entry->objcg, ZSWP_WB); + count_objcg_event(entry->objcg, ZSWPWB); - count_vm_event(ZSWP_WB); + count_vm_event(ZSWPWB); /* * Writeback started successfully, the page now belongs to the * swapcache. Drop the entry from zswap - unless invalidate already