Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1874986lqa; Tue, 30 Apr 2024 01:34:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjiUsh8g8f+FSvn6X7+9cxwR1fTsD3UQN69NPrO4iIu+q8nKyfW4XLdNk5v+jC+eu8jYHoBLeHI3dDY5iTsLlwXmYv96Vp4ltt2L0IkA== X-Google-Smtp-Source: AGHT+IEGR1Lg39p08mfp4h/TzdIkzRJXNySuYXdDhYHTA9gVjqU7zK/W/a52PFr09b1gDZt80FUP X-Received: by 2002:a17:903:1d0:b0:1eb:51a4:3685 with SMTP id e16-20020a17090301d000b001eb51a43685mr2043011plh.52.1714466095103; Tue, 30 Apr 2024 01:34:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714466095; cv=pass; d=google.com; s=arc-20160816; b=IoieAmIpaCz2i3LydPI1IC4oQUWPyKmGvNRl7ZzJGh0yWpRxFWjR9+Xw/q56JvDDLg LFMEAay3WB3ZhsN5azv66pVpoDz9H8E5LsBi2t9vk1E+hPO6ca0uDufl5ZQlh2h81lxP rbZTPq8n62bLF4kq34Ojiyq/6nzslJv+I1T+wWslWb/NDDeh7oLyvEgjxQO6OPhQK0oE MAHRtLUrOzkAOgbm2PeMWQwoV/i51Ky/lI1IcPft0Rwri1kBv+/rG4eBGRQwZC9E45+j m29/VymBbht7sB0MjNqmLfU8VUhksjqdb1hpUdex2/ICpxCfGGNmqo1lapfo1XywOzxh VU5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=aBu8BqMTHMfO28FxxomfhI3ilqxqETOIjPW5gQNZKVM=; fh=e48id6iZg4J9iW4VAzaaaS/4QCYmxNaHbkH1crYePuY=; b=rey+5EPwyTl3a9KPSHjIUQV8zykYCeQNS3wEOcB6z2Uh6A2L/0iTr8Y9ds07dFJEgL geYG6TKtcUyQzza8OKm/hypH9xxzh/JTh2mcJahrLI9if6Noh81Y8qO2XQAmidGkA5D4 /QiGwaoJUE0JjFmH8A5oE29ktznTwjMNZ27MinmnCTu84+Qxa+WjjMwQ/nr/e/CFUwWh hC7DMhTsABiCf+kK0oBDozuKn+xAzA2l4YyoFDwZtJA2/MFlkutBKlfFGXHJh4Adp3+M 0JCJWX/QCo9gg2UimgQ71AZycdNGtoqTxDKZwUNyyUHmVOB1HR3hbWmZdRmF5opAAxc+ IgVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xrlTfZDE; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-163543-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2-20020a170902cec200b001e01d62454csi22539911plg.56.2024.04.30.01.34.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:34:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163543-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xrlTfZDE; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-163543-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B953D28310A for ; Tue, 30 Apr 2024 08:34:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C8951272CB; Tue, 30 Apr 2024 08:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xrlTfZDE" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFEE317F5 for ; Tue, 30 Apr 2024 08:34:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466089; cv=none; b=LsDPaCSJXP8aPNMsdEMEGE4ONl6phlfBRAR7+jPLBm/L3ZXuZJa9jtbRawGb/8oMnmwKt52gjlFleQcqc8NsEtsxU3qM6W8DvIPmnM3ICbM5PMqxycbrkn4kLqaL8pd0gdZnW15X8Ix1VEOutMShiTTOmDkjI4aAYpj7JJaYUog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466089; c=relaxed/simple; bh=jPYNUDHO8z8R/AW867spSODiXpt3EDt4BNKxe4R+5dc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hIUUoWyLLzFn2gosD63kY07eNgPrJfZlYcnMlpGIat57t1H6KmSoOILfjCirnDsL4XC2uDRzQGRtjraDa3S1HNUBNq3d9MK5Ar3eaQJ4TInNdlpetksexsy3UabjSVjsZhwzDD++NSenuok7ZZ0lTRMcwMQHW7GwcK2LRd3GeFg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=xrlTfZDE; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-571bddddbc2so6378995a12.1 for ; Tue, 30 Apr 2024 01:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714466086; x=1715070886; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aBu8BqMTHMfO28FxxomfhI3ilqxqETOIjPW5gQNZKVM=; b=xrlTfZDEnzFIUxUZhOgeyPCLpPYYVfLnfxFJoROsGtd1Tt+s2n113jToHIu5l1Jr+o EVCRQryBrsHaAnunxqbEP8tOfnghfDMlbknMPpZLK6m9fZsCbS3+2DeFpvePw4nuTFpF yA0UGGB7QOUfkImt/xUBJ8UtEnM977HGPnDUMgaMBN8zhN4556SRZ9I83DfTLjBCBngL 8pJuWTLqoW4BwgX0TzSES9RF3IjdEDF44+lGo8XZYGh52IFSj8fO2Xs22rurXkdBGcHP 03D/foSBv94QKl8ehx3K/0xf8ZVcwCmL6jQCct+eyBjxN1Y3enUjxyoOOtDEFnskWi+I a/xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714466086; x=1715070886; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aBu8BqMTHMfO28FxxomfhI3ilqxqETOIjPW5gQNZKVM=; b=W7un3QhRSkVM715Dt6d61/VppyW/5R/ySzvv7TEGYnWM+VJwQh7p0X1Nh0/G6BXdjH lLp3ip1xbfjXShNtowVFzmF5HIQIVwHYpRvwa0+cTea1NHLyEjB1CU0aMXSIa/VdSCV1 x9n2RhBBWi6Pgk2dgcpFneU1IbKixpJkZoKtf2ge3welfQLkUZbyYATf+JShYoacyY4A 9aTjCSIrM6OP5+RWvSiAh5KtYIVRLqlmhts4oZ7iNutLo+lNsBcvPFe0GroJlFeFDFKB EQeBfyB6cGsU6Cotl1DCl1mer/NWg+OVuffau3CXRq6RzJsBJ64t73LO/N+YcTaIKwbn d9SQ== X-Forwarded-Encrypted: i=1; AJvYcCXTbXRO4CKWxvgD6K9zYvNH8GOvR5w8ddQXr74nOK8by9S2hGiNPETwvfRinosTi/BfcBH8TalTtXr5pH4sdX56kksayUUw5ySTn7P+ X-Gm-Message-State: AOJu0YyFE05rTW8up7TzYRkBZYzfKwRDSVRIr/0cdEQx+qw6jfiyagXA rNzZDAutVBYe5HqkQQ4bcgn2SJZsxAyyemssZZ14KJxkfQVxn6XHzWfshr7+TunnlxJLIQ3nlyJ A9oGRjf/Y3BxwR0Lr8Hyol0z4N7RC4vLkwYB9 X-Received: by 2002:a17:906:e2c5:b0:a55:2e77:c718 with SMTP id gr5-20020a170906e2c500b00a552e77c718mr8516330ejb.54.1714466086036; Tue, 30 Apr 2024 01:34:46 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240430060612.2171650-1-shakeel.butt@linux.dev> <20240430060612.2171650-4-shakeel.butt@linux.dev> In-Reply-To: <20240430060612.2171650-4-shakeel.butt@linux.dev> From: Yosry Ahmed Date: Tue, 30 Apr 2024 01:34:10 -0700 Message-ID: Subject: Re: [PATCH v3 3/8] mm: memcg: account memory used for memcg vmstats and lruvec stats To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , "T . J . Mercier" , kernel-team@meta.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 29, 2024 at 11:06=E2=80=AFPM Shakeel Butt wrote: > > From: Roman Gushchin > > The percpu memory used by memcg's memory statistics is already accounted. > For consistency, let's enable accounting for vmstats and lruvec stats > as well. > > Signed-off-by: Roman Gushchin > Signed-off-by: Shakeel Butt Reviewed-by: Yosry Ahmed > --- > mm/memcontrol.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 7126459ec56a..434cff91b65e 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -5545,8 +5545,8 @@ static int alloc_mem_cgroup_per_node_info(struct me= m_cgroup *memcg, int node) > if (!pn) > return 1; > > - pn->lruvec_stats =3D kzalloc_node(sizeof(struct lruvec_stats), GF= P_KERNEL, > - node); > + pn->lruvec_stats =3D kzalloc_node(sizeof(struct lruvec_stats), > + GFP_KERNEL_ACCOUNT, node); > if (!pn->lruvec_stats) > goto fail; > > @@ -5617,7 +5617,8 @@ static struct mem_cgroup *mem_cgroup_alloc(struct m= em_cgroup *parent) > goto fail; > } > > - memcg->vmstats =3D kzalloc(sizeof(struct memcg_vmstats), GFP_KERN= EL); > + memcg->vmstats =3D kzalloc(sizeof(struct memcg_vmstats), > + GFP_KERNEL_ACCOUNT); > if (!memcg->vmstats) > goto fail; > > -- > 2.43.0 >