From mboxrd@z Thu Jan 1 00:00:00 1970 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 ACBA6C3DA7F for ; Thu, 15 Aug 2024 19:34:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 477236B020D; Thu, 15 Aug 2024 15:34:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 425406B020E; Thu, 15 Aug 2024 15:34:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 314DE6B020F; Thu, 15 Aug 2024 15:34:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1368E6B020D for ; Thu, 15 Aug 2024 15:34:42 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B11D71A181C for ; Thu, 15 Aug 2024 19:34:41 +0000 (UTC) X-FDA: 82455481962.15.1E3E4A6 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) by imf09.hostedemail.com (Postfix) with ESMTP id BF887140006 for ; Thu, 15 Aug 2024 19:34:39 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=IJtNTPNz; spf=pass (imf09.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.181 as permitted sender) smtp.mailfrom=roman.gushchin@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=1723750406; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JX8hMzQyvTzhq1dmJHRzPorgDlX9GQbPr5AORp1ohCI=; b=BkSq2n9UDUzosuRBKXXJ/8b1tC4XC0T4RHC5X5qmySmN0QPrlURNadho/PHGrryt+dAc1T wmsTL7SJUEDx5tEenwp/4niNVy8H3yuE2q9lXC4rGke7oU8fjynxztC7Dbk/TZCYGmhQmt +W9cyeDp6zaL+TaZWnFur4anUsINs/0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723750406; a=rsa-sha256; cv=none; b=ltE2CHoZ92bVyHjDoGybukqM06Ci6wCefgRlzvCGYspjM4zYy7MMxTaBXds2n0E06sErE1 l++cCGQwnmf5ShOSPSK+xZVh6lypl8Lv0HwTtGzizlRlJ5FBaLqRvD6upTcR1SYXbpXCwZ 4F8PXjWGqVmOF7NGfRDmqYw1IzDRQes= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=IJtNTPNz; spf=pass (imf09.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.181 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Thu, 15 Aug 2024 19:34:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723750477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JX8hMzQyvTzhq1dmJHRzPorgDlX9GQbPr5AORp1ohCI=; b=IJtNTPNzSu0ieL/YMx9fnGOialFCiwR3A19CgU0DM1A8tqM9HgIKcKLtoYgSPWONvFHwAq lbnIhwsSFi8XMAacckAVG6Q8jRmU07uli16LW92LeaPj8S1s32NfTJWJyDY46rK4wq/+2R 7255dzoZcSJ5JWIkxsaIVJxWb0/7ef0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Muchun Song , "T . J . Mercier" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team , cgroups@vger.kernel.org Subject: Re: [PATCH 1/7] memcg: move v1 only percpu stats in separate struct Message-ID: References: <20240815050453.1298138-1-shakeel.butt@linux.dev> <20240815050453.1298138-2-shakeel.butt@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240815050453.1298138-2-shakeel.butt@linux.dev> X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: BF887140006 X-Stat-Signature: 9yfto77firwpajee4ee88fe7fwi6mgh7 X-HE-Tag: 1723750479-892460 X-HE-Meta: U2FsdGVkX1/OLjy0ZBVkmnUeJNT9wzIJdeCzVopwfXMPXeIKfc7fkzbe34mpWM1Dqjt1CustnUCHC9MAQNBHzNLaixgU7s95WQB4oeoqqqzc1ETz65iS5Ku7R0VkTbLAXsetbhLUI8TNMBIzVGL3Ja2gMbW8B5Rt71KV+ohU7BaM+IujjGgNwpTo9CJS2mfmnzHQ9XfnMHUKQzy3Ti0lebxcXVuqiwOFgJJYGw13MIAbZ/gCQlPC9j+G/xOJpOhx9JkNt1klCYB2y8+H0gQYFQKeHsaCDuA7SVY81r0+29m751ft89VIXQh6Py+hHhUjhCuvIRcn9/ryRr7dcZmhoXTpneKrm3nnTs2hPmrvFuvkNz3QgHmFsKfBBj7234qFpW4tnR0m+EhOazw6vNf7gVbzoaH5NeaWbXxQykh5C7MmVvyAW2OcqLnNdCLiO+eRlwcJDPPVET/tOMAPDx2TpPTjVEfua6RuIjCFqeiVJ3ZRpDTWKF5juuYT1gxs/FXvOXJxX6ua62e3WtTAcPdtC2OhtTPay/vz/WlvC11YhZ28c3nGVFAdQgww1Uyop4AK/E62HOqIpLvws2ToUeOEFCLWxvcyyIKKOIin2v2O1vwcV2H/Lzzd38q6/RWNtuCFMcQCIAJBMz7XwCaHx8YnG/qzrtgBXD4efZ2KaU8XAzoiVjsyfAJ7nnim1yaxrjgLBqhRCR1uteifXBviOzpbbEUZEQA4lXVSuJO8RIrBdTLvjCR7vJMomajLOK8BBr3qTZ0tzLIvlNOhyGK34jsjBgnT6QR+26HiDNe4n2VHe4tmcDPeuQLlW4Qjt9wup5FPE9KHno9dwlxrJZQW4mMo5YRDSwRyWjGTzPB8pB9NkR0foz/bxV/Me2126qUByWrnSyKpI60bFvWSpc33aQ2/kcEcjvwkG6FlYOzZPdg8nSo4mqJBP8uBOnRPLnAipiSLrpSK0FJ0LcrVSxDprNe M9uJsotM GI9P0nLpYJtliAMVG1lRAjQGTQfOv0MOVDvh5xB/t2Wqbu0vxJWyyIU1KHGCGLRAZmk5o2kK87dd/vk3Fyfil74eeWNAYc0uLeC4Uvw+4aHUn8wu6kSwUWplit0hablGlHCZbmRISXxIjTEK1kXySVmnc7g== 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: On Wed, Aug 14, 2024 at 10:04:47PM -0700, Shakeel Butt wrote: > At the moment struct memcg_vmstats_percpu contains two v1 only fields > which consumes memory even when CONFIG_MEMCG_V1 is not enabled. In > addition there are v1 only functions accessing them and are in the main > memcontrol source file and can not be moved to v1 only source file due > to these fields. Let's move these fields into their own struct. Later > patches will move the functions accessing them to v1 source file and > only allocate these fields when CONFIG_MEMCG_V1 is enabled. > > Signed-off-by: Shakeel Butt > --- > include/linux/memcontrol.h | 2 ++ > mm/memcontrol-v1.h | 19 +++++++++++++++++++ > mm/memcontrol.c | 18 +++++++++--------- > 3 files changed, 30 insertions(+), 9 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index 90ecd2dbca06..e21a1541adeb 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -70,6 +70,7 @@ struct mem_cgroup_id { > }; > > struct memcg_vmstats_percpu; > +struct memcg1_events_percpu; > struct memcg_vmstats; > struct lruvec_stats_percpu; > struct lruvec_stats; > @@ -254,6 +255,7 @@ struct mem_cgroup { > struct list_head objcg_list; > > struct memcg_vmstats_percpu __percpu *vmstats_percpu; > + struct memcg1_events_percpu __percpu *events_percpu; It wasn't really obvious until the patch [6/7] why it's not under CONFIG_MEMCG_V1, but otherwise the series looks great to me. Acked-by: Roman Gushchin for the whole series. Thank you!