From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muchun Song Subject: Re: [PATCH mm v2 5/9] memcg: enable accounting for percpu allocation of struct psi_group_cpu Date: Sun, 22 May 2022 14:40:49 +0800 Message-ID: References: <16f17021-61a3-c6f4-f60c-1acd3a0b66b9@openvz.org> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=K7RyeoE0RrByaysSlJBBX9kNbKUMbMSMjbmqSWxbdhE=; b=ydM+bNsTqjmSr8ProqeQ1dnTvVbgtRESYlEoGN63xQ08p6qUZBZ8ARuda6R7tenlb5 PItaErd/oEcrAc1DCgdWI7LH6ZRtMNz/DoGGOCh84+YU5Q7i0ntBxSmWbmqGvHiQo/FN h55AoRHBS45cyBSEijmVnKUoUcL4U5C/Dj79OcFUeKx342ypQzsb5Tu085LObSQiPcCA 5Mr9w1rlChRajAO3QRBd2B9T1KsrlmOccEpXvsNKkp2teVj8X4ySDFtSNVCLj0Ws60ln uUlySVvdc4029NfszkZDVLIsUDDTNP7cZ4HBLJqKBMy1o5ZV3WDwHf6TyTCZBMYi34UX phbA== Content-Disposition: inline In-Reply-To: <16f17021-61a3-c6f4-f60c-1acd3a0b66b9-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Vasily Averin Cc: Andrew Morton , kernel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Shakeel Butt , Roman Gushchin , Michal =?iso-8859-1?Q?Koutn=FD?= , Vlastimil Babka , Michal Hocko , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Sat, May 21, 2022 at 07:38:21PM +0300, Vasily Averin wrote: > struct pci_group_cpu is percpu allocated for each new cgroup and can > consume a significant portion of all allocated memory on nodes with > a large number of CPUs. > > Common part of the cgroup creation: > Allocs Alloc $1*$2 Sum Allocation > number size > -------------------------------------------- > 16 ~ 352 5632 5632 KERNFS > 1 + 4096 4096 9728 (cgroup_mkdir+0xe4) > 1 584 584 10312 (radix_tree_node_alloc.constprop.0+0x89) > 1 192 192 10504 (__d_alloc+0x29) > 2 72 144 10648 (avc_alloc_node+0x27) > 2 64 128 10776 (percpu_ref_init+0x6a) > 1 64 64 10840 (memcg_list_lru_alloc+0x21a) > percpu: > 1 + 192 192 192 call_site=psi_cgroup_alloc+0x1e > 1 + 96 96 288 call_site=cgroup_rstat_init+0x5f > 2 12 24 312 call_site=percpu_ref_init+0x23 > 1 6 6 318 call_site=__percpu_counter_init+0x22 > > '+' -- to be accounted, > '~' -- partially accounted > > Signed-off-by: Vasily Averin Reviewed-by: Muchun Song