Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3280034lfo; Mon, 23 May 2022 00:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6djdk7WsDBWdujDUFLnIZqpJAQMxtJURHRzjL99jEqmt54kXLllmNXfBHb8rDfFMszqpW X-Received: by 2002:a17:902:e747:b0:161:a2d3:d8f3 with SMTP id p7-20020a170902e74700b00161a2d3d8f3mr21363501plf.17.1653291274590; Mon, 23 May 2022 00:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653291274; cv=none; d=google.com; s=arc-20160816; b=n/EgKDPP8eXmfQNWaj8kZo9qvHOhsZuWoei5samtqZc1zfdvLMRpsDy0EvM7nBzfRb bI7sBk3sDr06kPInSeCqliPh59G5bKM4n0WSET88pkwZhFs6txpH172m3DjhRywCXM8X LyzXEuTOFe2PmFEtvk/z2UBkJ3R8m93y3cWefVjHUAR4s/Sky27OIv4l6BLzhcK0wBwd pizIGy3WrM2kg9JPysvcNBWkU/wic4qZksjGPAjd5AkIBaMKHl+QyvOG0uZXVyGyKD9N E1PJyGDZ9YBuMUFrGwokm/9QIXumWPS5r0pR9KcyY6stqC1hLiTSbu3nYx1HheSh2xm3 taYQ== 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=xBwtB9T65QzhNPtQZ0QXYA7XAPyjsJvSWqKsiu1+O3c=; b=XaKVH8Cx4KTWSuY7oSuCV3hrLkh5Nd1heBeGLqBQL/eiqGlaj/zu0DNguTi+X2zxiF h1kXwCCBzuTRD6Y2LHvdk/7W4pikWd6O4VU4THHEgPikK7E84JEo4HOEwQztLASqhb47 3QYGqU62oFvOnTqPKwfMNAax3+Br43JLWdvT4oEAR6mo0WpFu6cBGLx51A40lDdg0KGM slJ99AK7dM4eQQswUvNeDh2lJ8+qIvd6yllBGdocGm9X37GOf1Lzo8zyMr40t59HNiR1 S84bktwXDhqX2/1nOfo1GsS1gJcTmb5AIUfMrwN1Rln+J1s1Lcvvsr4zfrTnmaqhU7oh 4j8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=1tl+DtjU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id hi22-20020a17090b30d600b001df54bb6d5fsi12233610pjb.130.2022.05.23.00.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:34:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=1tl+DtjU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C47E1BE978; Sun, 22 May 2022 23:45:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243149AbiEVGuQ (ORCPT + 99 others); Sun, 22 May 2022 02:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239944AbiEVGuO (ORCPT ); Sun, 22 May 2022 02:50:14 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F08D536699 for ; Sat, 21 May 2022 23:50:12 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id p139so20363156ybc.11 for ; Sat, 21 May 2022 23:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xBwtB9T65QzhNPtQZ0QXYA7XAPyjsJvSWqKsiu1+O3c=; b=1tl+DtjUID/Yit6XMR1sy4CgTCo7HJWlhuAjY9JG40KKnRyzU6DDTBO7B8l8eQHvs5 HCM1hEkHgCiX8lbuD66I4Wg6aom5XMll2U7YYcjZ8YFM9a1TDI+HJflEKyxUunm8Lx5t 2DN0t8GjjEE5K2TKo4NqLvLu6Dqrx8grDcdVi34AwfAju6scjTPeKVdb0NuAEAZ9oDAh CqTsDqWcF3ZoMr7K1uQmsMtv5yVqDCA+QZsfWMEPE9pcfKpzks4o+OoxvCn8OjO9fHY+ u+6D2zwnTQKV7bZYNGgg6da2F230kRqfS2eXe9sPxUX9yJLUnrjbvXDNsYzkpHqJeN0V kKnw== 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=xBwtB9T65QzhNPtQZ0QXYA7XAPyjsJvSWqKsiu1+O3c=; b=bbYtD58JuyzVNIjDQH983Jv37egNrTTDUhUtSun4ux8BQpuMUrqmb3HM4kX+b9DDbU AmgfrVykQmaA/rGnCcLAr+/k8MUnezI4PI/By9ypA2hZOsOIWZIPW2sOmkzoN8DMkZjJ FOZgtoNZ5F75i7j+KqYZqSNjWDDYqOf/klQUjXVCsIFbS8QsiLvQHcpL/oBXm9HxwUc+ dqOmCf4MfSOVlOXwP5/ksnVBKdV49xQEikJCNVBVpNcultwWnlc3GYt1Ta9SewaQQuRx 3T8kXlmrxWPTGfNdJQ9HvDLBAkQhDzluGOvjssehVx5Y82KZLWNxznOGSazC6U+OPtSO OcJA== X-Gm-Message-State: AOAM531rPMK+gQh+X45HyWcMEz7hEkiL2Ay+sz9HEIVWzBZVh7Lb7fpz 0ngP83cZlPBxBS4Qthd0VZCVeXG+ATh3XhWjKclmiA== X-Received: by 2002:a25:3452:0:b0:64e:1776:ce90 with SMTP id b79-20020a253452000000b0064e1776ce90mr16686330yba.261.1653202212242; Sat, 21 May 2022 23:50:12 -0700 (PDT) MIME-Version: 1.0 References: <46bbde64-7290-cabb-8fef-6f4a30263d8c@openvz.org> In-Reply-To: <46bbde64-7290-cabb-8fef-6f4a30263d8c@openvz.org> From: Muchun Song Date: Sun, 22 May 2022 14:49:36 +0800 Message-ID: Subject: Re: [PATCH mm v2 8/9] memcg: enable accounting for allocations in alloc_fair_sched_group To: Vasily Averin Cc: Andrew Morton , kernel@openvz.org, LKML , Linux Memory Management List , Shakeel Butt , 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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Sun, May 22, 2022 at 12:39 AM Vasily Averin wrote: > > Creating of each new cpu cgroup allocates two 512-bytes kernel objects > per CPU. This is especially important for cgroups shared parent memory > cgroup. In this scenario, on nodes with multiple processors, these > allocations become one of the main memory consumers. > > Memory allocated during new cpu cgroup creation: > common part: ~11Kb + 318 bytes percpu > cpu cgroup: ~2.5Kb + 1036 bytes percpu > > Accounting for this memory helps to avoid misuse inside memcg-limited > contianers. > > Signed-off-by: Vasily Averin Reviewed-by: Muchun Song