From patchwork Thu Aug 15 05:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13764403 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 D840AC3DA7F for ; Thu, 15 Aug 2024 05:05:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65F216B009B; Thu, 15 Aug 2024 01:05:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E5B16B009C; Thu, 15 Aug 2024 01:05:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43AFF6B009D; Thu, 15 Aug 2024 01:05:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 22BB76B009B for ; Thu, 15 Aug 2024 01:05:43 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D1DB9413AA for ; Thu, 15 Aug 2024 05:05:42 +0000 (UTC) X-FDA: 82453292124.28.851D630 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) by imf06.hostedemail.com (Postfix) with ESMTP id 2F10718000A for ; Thu, 15 Aug 2024 05:05:40 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=olL28lu+; spf=pass (imf06.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.181 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723698284; 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=4eAu+FADTIrdS5fQdJHfQzYaBndTq6CMzABmov4I1A8=; b=NKAKhBiMvt5CMRUXtwjEy4SadT1EVPA9MdFrxL1A+233zcwK+F6kOsGaFRfmsiJQw7Da0p zt9WMLOMcFXyOG5XX1rOBCzdVX+Bpmig1w9/DFU52KpoZJby1yvhH7MeJg2G+hUUxfJfYj B0VYjPv+5jXekVbJVFFr6jtK/EdjKyc= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=olL28lu+; spf=pass (imf06.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.181 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723698284; a=rsa-sha256; cv=none; b=K+r1N4qRkRHRZ0K6f74C0Wju5IWbb7cAYjGbR7Tu23dXZeteYItfUHuggnls6ZkQr309wY rhPEHMaqAlTCjLAUWjzVpwk8iANmqoJi4+P6ZG3UkPhRwSEq3rDFaZN01u9Lq8in4zD30G r+0/+c564Kgf8YJWNkegdmL/bh7pENg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723698339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4eAu+FADTIrdS5fQdJHfQzYaBndTq6CMzABmov4I1A8=; b=olL28lu+B/zDWmkEuIbo69rLnNvVgmsmXU8CRoAVPnl5y2BaGzfXFuxPoLOVcbY0rq6D7C 8ngmcAcKiy7BJ07ngoQh7T+Um+zErT+SdESm4nRgRT4kPTIwD8f8Cr0ONEhBBEfoMRXMou nC2ywtg16+j82Juz7oq0kph1B4s92u0= From: Shakeel Butt To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , "T . J . Mercier" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team , cgroups@vger.kernel.org Subject: [PATCH 7/7] memcg: make PGPGIN and PGPGOUT v1 only Date: Wed, 14 Aug 2024 22:04:53 -0700 Message-ID: <20240815050453.1298138-8-shakeel.butt@linux.dev> In-Reply-To: <20240815050453.1298138-1-shakeel.butt@linux.dev> References: <20240815050453.1298138-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: 3hnigrs4okbr91tcyh49gui59fo7q6xw X-Rspam-User: X-Rspamd-Queue-Id: 2F10718000A X-Rspamd-Server: rspam02 X-HE-Tag: 1723698340-716350 X-HE-Meta: U2FsdGVkX19UlpcP1g+VOaUvB/gsP9USfBFhrMQqC/utwrMTEKgoMMlSlwMn9nsSANSsrbeDfQUjoqRp2r4/IIPGHUc2HzNUviCTx9w2St5QBy4pPF2Pw77E7wUqwR89FT5TfAKhg5wsOPqvC2HYqG5aUjBgdljgj5kJK9b2fEyE2rAlPjK3SPBh+LUcScnScCy/ZdX71fXgZDuIHxLXtiiabxwLDKOMG/AIK1dr2SixF/XO7vs+U1k75AD3ag9HX/QcRrfusP02x4GzFE8kVSmsdOivj0hv05vowX5NQoifJMeGkgrR71iyTPa7DhHb/gzYpyHn0mNCtjNsMMNtKaBCDOdba+5mZ6Nrvsf+oeB0ehz5uI4MYM2+tEO7K7kpILyVDJ6CRYRq6DQGqAScdnKIENnCHje6qJ935tkObnLaCNVO1UYlQ6EYgWoulhH5m+PItuYDegse7HoNv1eHn1zNfugFstoKmyzMQbKqYtc/m+OPu7HdWU5okOOe4bWTJ8lFoSAbvPg6xqH0VL78JOEFYYlHJhN/UBJHh0Lom4pR94hex3BNX+GBAOhp46vvVMRAKkqqB91GIFeMejsaBRXg6Pj1ajgoSGJgv2tyt68bBCPto3R4/nf/LjVONy7GU015qnYeUCo/Kq05ws4qAYXzTbB70Gd0lUoa3S19hT0kU54hH71vf+NtZh+0quQ+GPh416dUwP2O78x69reaZG0EjPYjZTqujLGEyeqlPOU8E/e+rHtSxo32lHmqrNlAZSk9hXs6vHgt6f21qABKZ0NqbKq0an7so/nP6vmMq+sFLRiF4q0+n5+Dyr4BS62QsqNBROZsETDKhs2UXG1wwyvZBwJ9OOMoZqde4G4p0RLc6s7MzCk0USiLonYoK2FbA08QxDw6a/xAjhQF7CBZBZCGx70UvuQs+wSqsM5yQ+Jrp22CO24FnESF3W+2snsMg/vgOF/do/BwTToihnE asdQ+kJG ckEX+DSNZxH1DOImh8F7BHXLuVaRF/DMmSdmngMOXUr/H+rmSrGvJVu6U7spzOC6tdhZeIF5kqOtrVpj5MdWq6r9/t6w/LSjR7Jk3mxCKrnurOcLE7vf03oP4dg== 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: Currently PGPGIN and PGPGOUT are used and exposed in the memcg v1 only code. So, let's put them under CONFIG_MEMCG_V1. Signed-off-by: Shakeel Butt --- mm/memcontrol.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c4b06f26ccfd..9932074c617a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -411,8 +411,10 @@ unsigned long lruvec_page_state_local(struct lruvec *lruvec, /* Subset of vm_event_item to report for memcg event stats */ static const unsigned int memcg_vm_event_stat[] = { +#ifdef CONFIG_MEMCG_V1 PGPGIN, PGPGOUT, +#endif PGSCAN_KSWAPD, PGSCAN_DIRECT, PGSCAN_KHUGEPAGED, @@ -1461,10 +1463,11 @@ static void memcg_stat_format(struct mem_cgroup *memcg, struct seq_buf *s) memcg_events(memcg, PGSTEAL_KHUGEPAGED)); for (i = 0; i < ARRAY_SIZE(memcg_vm_event_stat); i++) { +#ifdef CONFIG_MEMCG_V1 if (memcg_vm_event_stat[i] == PGPGIN || memcg_vm_event_stat[i] == PGPGOUT) continue; - +#endif seq_buf_printf(s, "%s %lu\n", vm_event_name(memcg_vm_event_stat[i]), memcg_events(memcg, memcg_vm_event_stat[i]));