From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F07F0C2D0E4 for ; Tue, 24 Nov 2020 13:27:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 467292076E for ; Tue, 24 Nov 2020 13:27:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OC9uvyAt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 467292076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B481D6B00CF; Tue, 24 Nov 2020 08:27:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD2786B00D0; Tue, 24 Nov 2020 08:27:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9980D6B00D1; Tue, 24 Nov 2020 08:27:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 7F8BF6B00CF for ; Tue, 24 Nov 2020 08:27:49 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3304A8249980 for ; Tue, 24 Nov 2020 13:27:49 +0000 (UTC) X-FDA: 77519389458.03.girl45_1913cb52736e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 0C01128A4E8 for ; Tue, 24 Nov 2020 13:27:49 +0000 (UTC) X-HE-Tag: girl45_1913cb52736e X-Filterd-Recvd-Size: 6584 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 13:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606224467; 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=Y2/e902e9Br5kZjYpjbyWiZrt2fAPRE5MmAKatrYqFg=; b=OC9uvyAtMMgu8xaORjZr9wxE3ol6U3ULozVy5VEyROYtkZP3/fs4BNwMwpwO/qxx2RPGaI 5MWM4rty4pUIOspo7KTnt68nq/ts0siP41IuxWWgYK521pJbQIYezVLm3VEQ9FyagQhSch lH5RyP3S3G5wVXN3ZeMMRSi2ALN3Wd4= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-7mz1jq6wNFmNqbioxx3Wbg-1; Tue, 24 Nov 2020 08:27:45 -0500 X-MC-Unique: 7mz1jq6wNFmNqbioxx3Wbg-1 Received: by mail-ed1-f72.google.com with SMTP id s7so7878525eds.17 for ; Tue, 24 Nov 2020 05:27:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y2/e902e9Br5kZjYpjbyWiZrt2fAPRE5MmAKatrYqFg=; b=pmSd62KDhbPaH/6U93g6VoscENnAg2Ax2ZSKYSLuef02JBBFV/r5Ns5NO4LHHtaR9r GuW/8WJqELyONDA+CWwjFD92i1lYgJ5st6N2HzKXkh+f6apb/U3zwqPEnw97JydPESKv vu7vj2FQB3kCXzABLQjp3GyBddQXGyI9R/WkUiI+8AWz6k0ZYgrN9qjj6gMAMM37oJBX 5r41XuszPb3fvVf+Rw3INpS6ptBIBj+3PqO4WIMRmN42/Fjxw21DlUqoXuPdM6qGPlBy Cz39AwjPKfNrrotfCY6+HPtibOn1yGsuEflkBtXCdU2msXXc2eUOdz1qKAKoSA+cQ/Nx s3Qg== X-Gm-Message-State: AOAM530f9fKYw4HO88ysZzFnkGCL2EsPAj4+J/VuV9QWT3DZbWliwvyp 6LY22VBPHrTioduMd30s3WyyT25OeMvb8NaENShbAX1TwHW+BVNSI7WvALhOtuS6Y0KJIyfzzUF zjQKhx940plZJZE0j/88zU6sWlA== X-Received: by 2002:a50:8f06:: with SMTP id 6mr4020685edy.39.1606224463774; Tue, 24 Nov 2020 05:27:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsQ5aJmrv6eFr6FBXOrS/cXuxVYI7QfKsrkkhYEITIdUP0Jyf1b55pP1DPVIA0oh41Om3yYLs8BYjRWRXoGUs= X-Received: by 2002:a50:8f06:: with SMTP id 6mr4020668edy.39.1606224463576; Tue, 24 Nov 2020 05:27:43 -0800 (PST) MIME-Version: 1.0 References: <20201124105836.713371-1-atomlin@redhat.com> <20201124112612.GV27488@dhcp22.suse.cz> In-Reply-To: <20201124112612.GV27488@dhcp22.suse.cz> From: Aaron Tomlin Date: Tue, 24 Nov 2020 13:27:32 +0000 Message-ID: Subject: Re: [PATCH] memcg: add support to generate the total count of children from root To: Michal Hocko Cc: linux-kernel , hannes@cmpxchg.org, vdavydov.dev@gmail.com, Andrew Morton , cgroups@vger.kernel.org, linux-mm Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=atomlin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000094e52205b4da464b" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --00000000000094e52205b4da464b Content-Type: text/plain; charset="UTF-8" On Tue, 24 Nov 2020 at 11:26, Michal Hocko wrote: > On Tue 24-11-20 10:58:36, Aaron Tomlin wrote: > > Each memory-controlled cgroup is assigned a unique ID and the total > > number of memory cgroups is limited to MEM_CGROUP_ID_MAX. > > > > This patch provides the ability to determine the number of > > memory cgroups from the root memory cgroup, only. > > A value of 1 (i.e. self count) is returned if there are no children. > > For example, the number of memory cgroups can be established by > > reading the /sys/fs/cgroup/memory/memory.total_cnt file. > Hi Michal, > Could you add some explanation why is this information useful for > userspace? Who is going to use it and why a simple scripting on top of > cgroupfs is insufficient. > Thank you for your feedback. Indeed, one can use a command/script to manually calculate this. Having said that, one that creates a significant number of memory-controlled cgroups may prefer a quick, simple and reliable method to generate the aforementioned data, for management purposes only. As such, I thought this patch might be particularly useful. Kind regards, -- Aaron Tomlin --00000000000094e52205b4da464b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, 24 Nov 2020 at 11:26, Michal Hocko &l= t;mhocko@suse.com> wrote:
On Tue 24-11-20 10:58:3= 6, Aaron Tomlin wrote:
> Each memory-controlled cgroup is assigned a unique ID and the total > number of memory cgroups is limited to MEM_CGROUP_ID_MAX.
>
> This patch provides the ability to determine the number of
> memory cgroups from the root memory cgroup, only.
> A value of 1 (i.e. self count) is returned if there are no children. > For example, the number of memory cgroups can be established by
> reading the /sys/fs/cgroup/memory/memory.total_cnt file.

Hi Michal,
=C2=A0
Could you add some explanation why is this information useful for
userspace? Who is going to use it and why a simple scripting on top of
cgroupfs is insufficient.

Thank you for= your feedback.

Indeed, one can use a command/scri= pt to manually calculate this.
Having said=C2=A0that, one tha= t creates a significant number of
memory-controlled cgroups = may prefer a quick, simple and reliable method
to generate the af= orementioned data, for management purposes only.
As such, I thoug= ht this patch might be particularly useful.

Kind r= egards,
--
Aaron Tomlin
--00000000000094e52205b4da464b--