From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751607AbdG0R4B convert rfc822-to-8bit (ORCPT ); Thu, 27 Jul 2017 13:56:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33490 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbdG0R4A (ORCPT ); Thu, 27 Jul 2017 13:56:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AB387DCA27 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=longman@redhat.com Subject: Re: [PATCH] cgroup: add cgroup.stat interface with basic hierarchy stats To: Roman Gushchin Cc: cgroups@vger.kernel.org, Tejun Heo , Zefan Li , Johannes Weiner , kernel-team@fb.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170727161420.2552-1-guro@fb.com> <6a72e074-e01f-b93f-2c03-2bd0366d005b@redhat.com> <20170727174613.GA6457@castle.DHCP.thefacebook.com> From: Waiman Long Organization: Red Hat Message-ID: Date: Thu, 27 Jul 2017 13:55:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170727174613.GA6457@castle.DHCP.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 27 Jul 2017 17:56:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/27/2017 01:46 PM, Roman Gushchin wrote: > On Thu, Jul 27, 2017 at 01:38:55PM -0400, Waiman Long wrote: >> On 07/27/2017 12:14 PM, Roman Gushchin wrote: >>> Add a cgroup.stat interface to the base cgroup control files >>> with the following metrics: >>> >>> nr_descendants total number of descendant cgroups >>> nr_dying_descendants total number of dying descendant cgroups >>> max_descendant_depth maximum descent depth below the current cgroup >> Both nr_descendants and max_descendant_depth can be found easily from >> userspace by scanning the cgroup directory. nr_dying_descendants is a >> transient figure and it should be 0 most of the time. So I wonder how >> useful it can be. >> >> This new interface file will be more useful if it can reveal information >> that cannot be easily obtained by looking from userspace alone. > A cgroup can be in dying state for substantional amount of time > (imagine a memcg which holds a page mlocked by a process in an other cgroup). > > The total amount of cgroups, as well as tree depth include dying cgroups, > which are not visible from the userspace. > > The main purpose of this interface is to have a reasonable way to check if > there are no leaks/refcounting issues, which prevents cgroups from being > completely freed. > If that is the use case, I am OK with that. However, you may want to document that either in the commit log or in the comment. Maybe you can also list the full path of the offlined cgroups if it is what you are looking for. Cheers, Longman