Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp72234ioo; Fri, 20 May 2022 14:19:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUnc0c5KorN2BRRQ0U1/d5HErN8h7MkpQv5ob6H3H4U/ETs8CttPzYdHKnbMTOj6KX5PNd X-Received: by 2002:a17:906:4ccc:b0:6fe:9155:47ae with SMTP id q12-20020a1709064ccc00b006fe915547aemr10035413ejt.246.1653081574859; Fri, 20 May 2022 14:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653081574; cv=none; d=google.com; s=arc-20160816; b=xsp8+71+ctHaZBR926u+Nt8PwwjCTQuUcCssID3YHcQYZEhlkY9BMRJ8FWi5OehiGt EIeTxK1unG7iO7tFN3PBCoBaz4T2O442AL5KJ/EJKmlUZ6JC/ABk7uNLquBnrgItr4PT Uwr/EFfOuCtRRSiEqNOXW245bHqoufuayZqSWhxHos4e8KBPa9fnD9+0DG/sXWx+GKBP y/hv3+MrPxC74/su9pOn60AtUZwGoEFrpTB3cwOC5c+sUchkscFy3bn2Q8J4eE9zgYso IHwGSykQ84OybTaWGlttWkggBH2MtMZpYPht0PBXnqpcNnqK6vx5XHfR72xY+15YGbHl Azaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=qdKh+N5pd3RacKLxyxnq7jBphDna5YoiYMrg0p2wipA=; b=iPEZyyrEDoL1iQdo/CstIz68lZczNSCDvXpoEfWAlTMYakCDOdDOjhGBDHqANYBeeA ho2piwZLcY1OzmH7PV7uwOlTtO4ZdYEpIJelAc2MEnWLvwu605IHKhN6Tk6fWT5zvOKF XSnlKQyL3jJKx+DT9Opx27U862EFSnzc7EVJ+Lbm2uGrdGZRAaktE+tKxIxbWlcHQUnb bVeEUdPoOHp8cytyaWl9tpSyHy3fSD9QPpzSG4jpomcWy6MpS9vUhJmktxVgE8ycz8/O CZ7vPkzBDki6gImVYukYW0SiOp0hsoWORXz3krMvKoVf/uLNe2rvRu4GvN6Ay1xAXmL3 RPfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=5jgKeLMV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb36-20020a170907962400b006feb8cc461esi805323ejc.416.2022.05.20.14.19.07; Fri, 20 May 2022 14:19:34 -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=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=5jgKeLMV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346379AbiETHYQ (ORCPT + 99 others); Fri, 20 May 2022 03:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237685AbiETHYL (ORCPT ); Fri, 20 May 2022 03:24:11 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41DF14ACB9 for ; Fri, 20 May 2022 00:24:09 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id m6so8731252ljb.2 for ; Fri, 20 May 2022 00:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=qdKh+N5pd3RacKLxyxnq7jBphDna5YoiYMrg0p2wipA=; b=5jgKeLMV735gNvNQvBxyWcKxrinA/LTQb+b782a1NT6dU8Hb8SwexSfGf3rr6Urfg/ A4ulspIJhZ3yOgPJZd+EKgl0kpahqXgFG9HCgN1Wc8GjBaWrXg58cC/HpNBxipLfUVmm C4fRFmODcna91lSjcUnQol9cuES8Sfnijsv9sdrHJicrrtFayez6dTiUhjC7pthBoeHx YzHcD5rk+a4JszXIOzAp2/GDY88BpXCM9JJQ5708wwNf3+X8K7fuOM1ykSdVtKAi/wEY AAcr0ZK59rSxCEkQPd0o2XuJ8TO5oJrKJjaWcEdEDp+nfQDK0PNHPwv3MkelltsubHI0 Rj8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=qdKh+N5pd3RacKLxyxnq7jBphDna5YoiYMrg0p2wipA=; b=63fiKJDWXDo46xGJYusB0QuEZrNmeO1iaXYTTVKLz9j10afXrPUsJCKsQryfRF2iT8 XEKpa7vpGshsZ1yatjFGrG8oGXcAUrCZmWqL9EoPN2sI3uOLoF5zgJQfRoebRSD79dAR BMrB2fHQOyfrpu04gY3pBbwXbc2tQE9oGRm+zqu859cRncXc7EQDY5H1Brraf9jvPNR1 ygX+F2to+VlKQiRJTEm0zfl01xb2AXAAdCQY1xba8DE9BGUpW8MtbYSfwFuH/qray0hs /UM1zKpX8LTBrRQ3qpSIfbRjfKXwWsEx2mMZ4kkik6I25eXF+hI635XiiWzbvGNkhyNZ Nfmw== X-Gm-Message-State: AOAM532s9s0TD1lyknPeEqAj44ZQl/SVG2bqFCO6Dj9n0aB1Zlq8NeO4 qhRSxx2tyXGyMMpF423D5cNpsA== X-Received: by 2002:a2e:a88b:0:b0:24b:5714:213d with SMTP id m11-20020a2ea88b000000b0024b5714213dmr4795246ljq.412.1653031448051; Fri, 20 May 2022 00:24:08 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.185]) by smtp.gmail.com with ESMTPSA id n3-20020ac242c3000000b0047255d211e8sm550736lfl.279.2022.05.20.00.24.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 May 2022 00:24:07 -0700 (PDT) Message-ID: <740dfcb1-5c5f-6a40-0f71-65f277f976d6@openvz.org> Date: Fri, 20 May 2022 10:24:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 3/4] memcg: enable accounting for struct cgroup Content-Language: en-US To: =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Roman Gushchin , Shakeel Butt , kernel@openvz.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Michal Hocko , cgroups@vger.kernel.org References: <20220519165325.GA2434@blackbody.suse.cz> From: Vasily Averin In-Reply-To: <20220519165325.GA2434@blackbody.suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 5/19/22 19:53, Michal Koutný wrote: > On Fri, May 13, 2022 at 06:52:12PM +0300, Vasily Averin wrote: >> Creating each new cgroup allocates 4Kb for struct cgroup. This is the >> largest memory allocation in this scenario and is epecially important >> for small VMs with 1-2 CPUs. > > What do you mean by this argument? > > (On bigger irons, the percpu components becomes dominant, e.g. struct > cgroup_rstat_cpu.) Michal, Shakeel, thank you very much for your feedback, it helps me understand how to improve the methodology of my accounting analyze. I considered the general case and looked for places of maximum memory allocations. Now I think it would be better to split all called allocations into: - common part, called for any cgroup type (i.e. cgroup_mkdir and cgroup_create), - per-cgroup parts, and focus on 2 corner cases: for single CPU VMs and for "big irons". It helps to clarify which allocations are accounting-important and which ones can be safely ignored. So right now I'm going to redo the calculations and hope it doesn't take long. Thank you, Vasily Averin