Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3265932lfo; Mon, 23 May 2022 00:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywEcdLtf+yaa5sXtHgPMSuMtSatXhs8vLjPHY1FwRZcKMeLQikYrK96lPNcsmZGl73bXSf X-Received: by 2002:a17:90b:1d86:b0:1df:f670:dc51 with SMTP id pf6-20020a17090b1d8600b001dff670dc51mr17609549pjb.126.1653290305533; Mon, 23 May 2022 00:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290305; cv=none; d=google.com; s=arc-20160816; b=WqPuMdOqRGCpVyI27Bn2EVJItVKR+7ACO1iyfuisyGocdHVaIAwNX6zbDTv5xaaiJ8 iAC/YJoVWtJbsbQsJfxV28CDkJkg2dJO0dkLUHzI6nN+I2XyTTRQwIFSK4IV73DG+cg7 Uf467BOEaclCTLp303h0lVNS2/T5RJsqfLkVg3SgZM0TPD6EWHEpDO4m80w6JP0CbFii Hgfrq0pHxsGlIPfMR8TcHBeLJWu0g7xNTAkdd8E31YhCyt/Q1aTM/oWGXOYSV6F70SyD ALJQ9YIieA8cyo5HMJJdGHWedFSAY023csJuKkbJEu1bPRzGCVPC/OovrPGBQeQrTEdq qzEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ovbs7SznoJE1sVxkoT4HN7MF5cA4tFBx5ooIOKpQ5rI=; b=NwFQY6nCUW9A4wSVLpFXPUrDrn+djh8AQURFB/hhrstJ70CFe8tLIR13xKkN/Ci7f5 4EbhQSIhPO6BQ0bvH5gabf2AnbngO9BX3HOVYYlxy/7Kq/icbn5nkbx7QkdnYQjmZuQG cAeMaSyuRYFsxBvZo99lgeLCzib4tNMOqTxqlQri5Umj/Dz6eDK85Pi9hQ+/CbVLCwPn 7JktqDVXZx+KKw0MN9C5TjHLg/QlrvuZcT3orAynPY1Rcmixu/5CHKGloaCUG1iX2UCJ 4laBrPvnPGEpr/Fq3YDsmLNUoduxOvTPJPCz0f/8gWOwUVBt48nGhDCrd1D5ZuX4dyjn c+HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HtMT4pCc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v4-20020a17090ad58400b001df7618121bsi12852995pju.72.2022.05.23.00.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HtMT4pCc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40BB43C48B; Sun, 22 May 2022 23:35:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346602AbiEUVgP (ORCPT + 99 others); Sat, 21 May 2022 17:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346607AbiEUVgD (ORCPT ); Sat, 21 May 2022 17:36:03 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F06462CE11 for ; Sat, 21 May 2022 14:36:02 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id h186so10540496pgc.3 for ; Sat, 21 May 2022 14:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ovbs7SznoJE1sVxkoT4HN7MF5cA4tFBx5ooIOKpQ5rI=; b=HtMT4pCc5uH63EO6XlkrHpLrHOUT2F/DcCheEuURYYK0r2GEGrJzb/3oD1DgUHGgbS DTZvc7agujFsGc8vMopNkC6FjfuUA9MJkZ1FHzoiTFJd0SVGVTNnT9W5ykihOzFgtLAr S0EWv4ixlw92AThV7s6hF6xrQQfmjkH1fSqJgR9tQztQtG03xBmGq0UWxi5Sdtkykpri hadLh08mZRRFMRw+n0UWus3QJC6eVtN5cCmJjI/1F727JI4G0yv5iVqGWpauiYPRlPlx kfbkguPiTMODEoDYwaJS3f5Na9KWMUkMa3aNy8bN+imxqdX4Zat5tfu6XlyOAvSHZtLF apBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ovbs7SznoJE1sVxkoT4HN7MF5cA4tFBx5ooIOKpQ5rI=; b=cAuJ7wCGZeiA+DmG5ct43hM1Xs+x1/Pdl7VvO2uf2FyBzHnEftZGeLEkTtrOfll9ca SggBaU8QdoRqSExli1DRF6/uaZTYzJ2mv6tJgdNWhOehMtqhP3xR60FxwAfR5m+Dy9Qm FEs6B4ycBUDsvoarznFIfryqIL3OjMgOBTgaHxaoKj1Utk/O8a3cQnZtAoPFcWDGtdPR SBVfbBO0jUv39bxjc1TIw0P9vevsNFzLwIBpXx1QF+S+No/8gKCct1/lHimXEjrWrOGd 05Zx5FnLWmIcwBJXsrzV3A+vH9cPzva2zpjbeNbvikny5s6RtUr4oEUqumqF4cBhUyu6 A1dw== X-Gm-Message-State: AOAM530CE5HS19hf0gNlLsBFjeoRluaiI7eX78gUWGBQBZQREm5Z8VJ/ 0NlAkEy1mw266Nkcvtqyju8FAN+tN+t0axNJgH3MiA== X-Received: by 2002:a63:f0a:0:b0:3c6:e825:2431 with SMTP id e10-20020a630f0a000000b003c6e8252431mr13968312pgl.166.1653168962273; Sat, 21 May 2022 14:36:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeel Butt Date: Sat, 21 May 2022 14:35:51 -0700 Message-ID: Subject: Re: [PATCH mm v2 6/9] memcg: enable accounting for percpu allocation of struct cgroup_rstat_cpu To: Vasily Averin Cc: Andrew Morton , kernel@openvz.org, LKML , Linux MM , Roman Gushchin , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Vlastimil Babka , Michal Hocko , Cgroups Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 9:38 AM Vasily Averin wrote: > > struct cgroup_rstat_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: Shakeel Butt