Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4119546ioo; Wed, 25 May 2022 15:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5yGHf0GQsriDY1ywDZdSd0FlkW3Gmj/yrjVWhP5G0hR55jjvsysCFoB4FniAh864l/yLy X-Received: by 2002:a63:9752:0:b0:3c6:5a7a:5bd6 with SMTP id d18-20020a639752000000b003c65a7a5bd6mr30892805pgo.390.1653518618881; Wed, 25 May 2022 15:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653518618; cv=none; d=google.com; s=arc-20160816; b=JEnAdW4PNaoVoRVkTjfn1oi1IRS/bhIsYoQL3TYAVxm5iUmR/adEkdkr38U7Fh2Ukp X9mM/t7H/neRyxXzKwnl+dhci9FwvoIOY2BnFtb/hW57PcOMckb1L9/l8cqvJhJ2MPS0 izVU/m1HRakSaxrJ/BcIhLUABzfKJO+Vio2xZd1Jetx1NM7mFYqshuwcfIvymt3wh7Xm 77GiRiiQ02vH151tnKDprX2By8obXr6OCmMxyM3eTcqdRFGeptr9uwqrsyW3ZskL6PNn r794wzLDZuRvAmpDsNvhLQJsQLbFWe0nBOzkAolnlYa6nLsXmESOOd1xjeMAe5ZmydgV uUMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=BqHyQcO/EPCHDY1xe0+4wActLlHOlU2jbcY6btA4FPI=; b=mw70GTtOapfmMciKBn9hh9pe9GJCDajfjUdBvfMV7f6OscnQL0p5IBf/VvOe8ykjme UsCV1swiH1vjj+Vb+HGShnKJWpiSXgVGQ75watALJ6HLMXPTPX0gfjmnP9nemO67esC8 ycxtPNgGT8ORG6vUT6bkSUrpMhVHAqSbjAoFgscMyQgqsNnw7gR8dkZjvPX7JPBCE9Os GUKRsg0LbbHgVb+ovI+3GeMxjcJZ7zHQ5YJQ2zN/4gHPesfEwM6LqwcMlmnWSPG6xeIH 3wwMDwsrCjnqmZiqEzoxg60KnovCOau4h6dckrghGC9ZUyqyvMXXLAP4sZcykAWTU2kU oZ/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IqC3gfAE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 186-20020a6302c3000000b003f4e63b4685si196755pgc.613.2022.05.25.15.43.22; Wed, 25 May 2022 15:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IqC3gfAE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243140AbiEYBaz (ORCPT + 99 others); Tue, 24 May 2022 21:30:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237663AbiEYBax (ORCPT ); Tue, 24 May 2022 21:30:53 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECE1D712FB; Tue, 24 May 2022 18:30:51 -0700 (PDT) Date: Tue, 24 May 2022 18:30:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653442249; 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=BqHyQcO/EPCHDY1xe0+4wActLlHOlU2jbcY6btA4FPI=; b=IqC3gfAEusYUngfhPDQZyN41hUHpicr6FUJlsvV9XN4K1/O31k7g3yqgW6376yJbiURLyW 20n5GAtkF2694sJcddZ7ypbG6LGvwlQK2WiFktmvfV+7xQdG77X9Z7kjg5F/Re/LmpS5+Q s23gJXYBOL5RQRc5tIVrC07aijyGkHk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Andrew Morton , kernel@openvz.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt , Michal =?iso-8859-1?Q?Koutn=FD?= , Vlastimil Babka , Michal Hocko , cgroups@vger.kernel.org Subject: Re: [PATCH mm v2 5/9] memcg: enable accounting for percpu allocation of struct psi_group_cpu Message-ID: References: <16f17021-61a3-c6f4-f60c-1acd3a0b66b9@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16f17021-61a3-c6f4-f60c-1acd3a0b66b9@openvz.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Acked-by: Roman Gushchin