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: 174177 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3660934vqy; Tue, 5 Dec 2023 11:33:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHX0ZcM+E+lptUqKBIFQ1Uy/1KWUvaQJ8FUS3pELvkA6xQkVNioJQNw23yLqtNwCS2HhFQU X-Received: by 2002:a05:6a20:4326:b0:187:4e8c:ac5c with SMTP id h38-20020a056a20432600b001874e8cac5cmr2977820pzk.1.1701804829535; Tue, 05 Dec 2023 11:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701804829; cv=none; d=google.com; s=arc-20160816; b=eVxL0U8tQWqdKjoHnYkslPWfCkWXCt2fIW6fgi4MwsUVqVarMqZL80zelAICft7ab5 UBdroLA0QUimCc5/L/4h1WsrBZHv3EGA7zpwwyq96iXdAWqhr43tZjMZ5lwhZ28yTdQ9 wVjsHMqABO0A2aQDznROn1eTCTnVEQsCmIRFI2zDhV1oz7CZr4P00txca3v3cNLnbmoA l0YoAVrOi2oPwGA8BOaqVgZ450bPgKTF4xPEABjYGLQsUY1fbJvlgl+K+PI0Dc+qwvCI 2vJHN/Rl+3fM561wgOE1zTIwoTPwVaYDiobj797oHafPj7kAqWQ3sR9ggKdnr49lttXU bvNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yzmYrhMAdXLD+///kOQIC9tqV0WlC8PR4PrJXczDCuA=; fh=5ynFD2G6LA0fdRuAOSZxbBxHoIIG4U3xrwbnkupZs28=; b=EEmHSq+g5EOkhbS/E/I9fNZRRxGqIxAxhhkRyfvVl2TzpPVTglZGj+5MazfptgarDb vnY+/sZ9cRYGEcg4QDgfRHBJ+t/AEEw34bRxIShra8OHiU1tTI7AM7wzz4Ca2hqhP4N/ +RGo7rRpi0c3TOxfmG1sYVNO4v84aXo8JSeKUxGFtNsydaKKRjMCG0nM2HfCnA4vwRvl 8czcMh3T6FnTW3hiuCsa2ogmOyKt9nazSxMN9LfGL+virgvZoAUQdN0DFrUP2S41o0sF 80ajM+NiRfo6p07uMOS/StCMFsOESbJOOoKowSV+EUWFsBjWKvD1qgzxVT+cwso2HfBn j6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=niiwfymB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s20-20020a056a00195400b006cde431f380si3392693pfk.246.2023.12.05.11.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 11:33:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=niiwfymB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8248981EB474; Tue, 5 Dec 2023 11:33:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbjLETdD (ORCPT + 99 others); Tue, 5 Dec 2023 14:33:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjLETdC (ORCPT ); Tue, 5 Dec 2023 14:33:02 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21B8135; Tue, 5 Dec 2023 11:33:08 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6cb55001124so100983b3a.0; Tue, 05 Dec 2023 11:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701804788; x=1702409588; darn=vger.kernel.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=niiwfymBFlnAEj91h3Up14afPf+5D76XaYmdiYxuGMuFQoJL5T4WExh9gU/luefC3X HxfFOAC5bPPE1J1uitSebgEVhXsFYe2C0OXw5agM7Gx0R3xvF62mHFQXnC5+jNcHQqkb wtw5j6oa9QePUXlBWlx2nKIvKRcyFzrIjHakqpiuaNi07wO6ZVCgWKcmBkfrQATy4oIC Ry5LmQdWTc7BJkRZ9vNhGfnEi0d8aKO6LIHCVGpHS/WxgvHYNgkPlbPX+uerWsAUo9is j2dPiKDkB8+b+FZhpRhId9o1QVNhV6h9+k7qzrMFtQBzi6KMrytqhOA+UOeZ41lp97Al LUEA== 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=EGWzylp1pRI+gMBbb3r7NpNrlFP4+IcSF/MviYoqy6He657yO4VqOfr+CsSKIzCQQT ELZx7+TPwUHdFX8z9/df7sb9ZXWDfofL8TAIa27ALwiRugn50/OJLuQqzb+RVped/h+l zNJpTboZkHeA6AfiLJIU5l9LIoQHRKq2oQ6dJa7gsXCaFaLNqKkVk9LjxoAlEMGYGZ19 VYBcWovxd4eg09B4moGk9hYR46ZmdzI8g1bv4KzP/DLz306kEEkCrkOuCg5GJxRZ6+RQ e4HLm11hhqcThiLLo29y6xwidIM94oxTL37TFs+ijJCnx8K2NeiPptcXDWMUbgmeDp2n Hkqw== X-Gm-Message-State: AOJu0Yw7jrMLo8iPKRiXQqxic2g7OxgdBKMeiRGf2G8OLCWM1v9PSQDT 8sfkK7lHV1/zSZjnlomcrXc= 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-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 11:33:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784471700605800768 X-GMAIL-MSGID: 1784471700605800768 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