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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 40269C56201 for ; Tue, 24 Nov 2020 13:36:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF1C420708 for ; Tue, 24 Nov 2020 13:36:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gsV9KdM/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388409AbgKXNgS (ORCPT ); Tue, 24 Nov 2020 08:36:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52802 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388314AbgKXNgR (ORCPT ); Tue, 24 Nov 2020 08:36:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606224976; 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=NmB+/CVA1mnMQlH6qVDGPxzbBFzcsBI6srHn67igccA=; b=gsV9KdM/YQkMxbJBYxOowUm3+1oWNEUVlQatMAZTy3tySUu90rTuYOtNtMoR8hmT3ElC1A kGyhRAAigowjx3Fwvv8HFIDlYSj01UQaGmfg9JMWgXwAGXG/DaaB7J5dh6y9mYAQkCj8fs mDSLFDs7mMI7SILqUHioJwuV4wy0W1w= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-hx-v_bO1O3qrxSZ_4lAuIQ-1; Tue, 24 Nov 2020 08:36:14 -0500 X-MC-Unique: hx-v_bO1O3qrxSZ_4lAuIQ-1 Received: by mail-ed1-f71.google.com with SMTP id x15so7922705edr.10 for ; Tue, 24 Nov 2020 05:36:14 -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=NmB+/CVA1mnMQlH6qVDGPxzbBFzcsBI6srHn67igccA=; b=GuOpEZ4J+/W0wYouAH+C+29faZtITmrndhWy7GFMAgTmcLXc5bo4rduU6P9BdOCzUF G0eSPNzB1rwOguKXZAjFrjdw/oRhkXDXLwTlm21ooSC2HQC5eJRmPcIzZpmXI4o/OAsn WjX2ZBWwJJspmdhMwfg7Da2hkXVoAPcRvY260TWbEiA4uWsDOtyuJ+5vJAprFmDm+WJD 7OwWfFu/QwtyGuULTys60jvBJLSYBciEHhUIykeNXNYKuucjF5mZUP5dWAQ1kjBsTDWB BMiCcuwDtjJ01xcq6s7dEhnxHRwNz4fwhH+4ekejdzGiD2sc8W85l2voear/5H96u0BC HjyQ== X-Gm-Message-State: AOAM53362t7OsgmakxHmqAdBiaFbrbT1JNZp5HZoixt/7Z882H+n8BE+ tBBoQFsUCyrCOaQ3oJtbWehqymhb3QJtyiLUGELwrp4XqhnkgOuxK9hEnP0mOnrf7fH79ZSsIyK hStO4lN+jFx7e15RXeL9zt9qN7QuSyss174fWopc= X-Received: by 2002:a17:906:4154:: with SMTP id l20mr4250328ejk.96.1606224972733; Tue, 24 Nov 2020 05:36:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLgDbRxAg0TN/5K6JMqyzhfN/CF2RVQvZyZNIJ9qnPaKoz49FJ0/KWFYWQb2Ccdbt4ydh+BSG7gnj+/67GBf0= X-Received: by 2002:a17:906:4154:: with SMTP id l20mr4250314ejk.96.1606224972551; Tue, 24 Nov 2020 05:36:12 -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:36:00 +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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 77672C2D0E4 for ; Tue, 24 Nov 2020 13:36:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 00466205ED for ; Tue, 24 Nov 2020 13:36:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ahrL2JSy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00466205ED 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 6317F6B0132; Tue, 24 Nov 2020 08:36:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BA176B0134; Tue, 24 Nov 2020 08:36:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 483366B0135; Tue, 24 Nov 2020 08:36:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0002.hostedemail.com [216.40.44.2]) by kanga.kvack.org (Postfix) with ESMTP id 2E9F86B0132 for ; Tue, 24 Nov 2020 08:36:17 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EFE8D1EE6 for ; Tue, 24 Nov 2020 13:36:16 +0000 (UTC) X-FDA: 77519410752.27.cord75_2311f692736e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id D29793D663 for ; Tue, 24 Nov 2020 13:36:16 +0000 (UTC) X-HE-Tag: cord75_2311f692736e X-Filterd-Recvd-Size: 4422 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 13:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606224975; 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=NmB+/CVA1mnMQlH6qVDGPxzbBFzcsBI6srHn67igccA=; b=ahrL2JSy5JcZbdYzMLogpp/dfYeJIUgR6J45VcDJRUc2vxWIikYzoMGeeEnnXSW1HQr1TD g+Zy/3zmJt9rLXMHbd5QpdoCyjP+WcGk2Q7O5EWj6h7MjnwtyC/LSh9K7/TjTBqy9HVgEk Y7mvLDyZzTtADjXsKfyNIfOjCh01S0E= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-45pWope6NvqZI0hXOegIXg-1; Tue, 24 Nov 2020 08:36:13 -0500 X-MC-Unique: 45pWope6NvqZI0hXOegIXg-1 Received: by mail-ej1-f72.google.com with SMTP id r2so3928472ejx.9 for ; Tue, 24 Nov 2020 05:36:13 -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=NmB+/CVA1mnMQlH6qVDGPxzbBFzcsBI6srHn67igccA=; b=b20Ep00daoqjhk3KD+XOi6V2/53a2ABt/fQrXIZ3xz63YfOjvlPLoenWJl4uD7LK/8 8wBffbNeh0Elu1FSnqMtiW1cMExwSLj/cU7FW1R2TfcpUtdgHVqXv++toCUccDXAyuh9 W9bR5yKbP6aRmXVcwb84h/ftyvXK86LgLDtPD8ZQ4oHuQmiplW9wiwGCG+4Bgvz0CFTA 2KVPkr0b51oldbrdunca2ZCIprX5o7lwDVU6iuE0oanbtBV1paeiBD2UwsJGim1K1AuQ NNOukLYX4WVTiOrSu6TAy7LE3GOWjsMzWTv3BwpHqLk1fle5dkBZIQir3bUa8Bel8PDf +8fA== X-Gm-Message-State: AOAM530KC23QTKJWOvibp26JPesgtp9bJzji3dPOI8t9G0CYVJekXekl SDJ8BNW025R6QSE1LQt51WuDvZqU99kmyapgxmeswHYAfRw/uJk9R46h6JwPjALDWlzUIKRU6mh U/zrZ0cdkbZXmdl73RhgiQNR8yQ== X-Received: by 2002:a17:906:4154:: with SMTP id l20mr4250329ejk.96.1606224972733; Tue, 24 Nov 2020 05:36:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLgDbRxAg0TN/5K6JMqyzhfN/CF2RVQvZyZNIJ9qnPaKoz49FJ0/KWFYWQb2Ccdbt4ydh+BSG7gnj+/67GBf0= X-Received: by 2002:a17:906:4154:: with SMTP id l20mr4250314ejk.96.1606224972551; Tue, 24 Nov 2020 05:36:12 -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:36:00 +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: text/plain; charset="UTF-8" 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: 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Tomlin Subject: Re: [PATCH] memcg: add support to generate the total count of children from root Date: Tue, 24 Nov 2020 13:36:00 +0000 Message-ID: References: <20201124105836.713371-1-atomlin@redhat.com> <20201124112612.GV27488@dhcp22.suse.cz> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606224976; 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=NmB+/CVA1mnMQlH6qVDGPxzbBFzcsBI6srHn67igccA=; b=gsV9KdM/YQkMxbJBYxOowUm3+1oWNEUVlQatMAZTy3tySUu90rTuYOtNtMoR8hmT3ElC1A kGyhRAAigowjx3Fwvv8HFIDlYSj01UQaGmfg9JMWgXwAGXG/DaaB7J5dh6y9mYAQkCj8fs mDSLFDs7mMI7SILqUHioJwuV4wy0W1w= In-Reply-To: <20201124112612.GV27488-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michal Hocko Cc: linux-kernel , hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Andrew Morton , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm 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