Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4205676ooa; Tue, 14 Aug 2018 02:42:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwWSHj1fzdO9hirr2qtZx0sww/ZK2hWfg3cd9Ks6Ce3WZOP07hfPrsW2bEieJIKXj81EL2D X-Received: by 2002:a63:c44a:: with SMTP id m10-v6mr20394639pgg.416.1534239732117; Tue, 14 Aug 2018 02:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534239732; cv=none; d=google.com; s=arc-20160816; b=ix6vypNvKSnpH0I8lrZ11u1/nCSVSuiFFaO5DODvArA8XIA7G1PqfJ1+vLCzAco/Yh a3LkzODh5uhlmwJhu4ZYOvJ/Ie6u+eLd2NQqXaYyL5RJpBFGlHe585Lvy/4LcxIt8dsc c+d31+IE2RFKx42rg/g/Y2B6HnMfRphiq1yW4THfXuy5vbrWqnqLK8INtxBmZheOfCKo I37Em24Z42p0VZDG1my5+Ddy4h+hdqiraOms3TdEv4TVgT6aYCezIpu0VLwbkexVragr IHG1648Mo7EBIQEg5kg6grkOt0DWhLt+jy0EDRLS/eXwKCfTlFS4L0Vrmp8crlbSK7Rl SL4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :dkim-signature:arc-authentication-results; bh=YxzDZA3Ck/k6jC7qMmngKFEGI7qDuhDO1A2jVGo9ew8=; b=h28qeaJL1PdsjFz34jSLtHG8AUU0HUNVow6DOWR+GvjHIsqPRMj7YJKfbknzHn6ZSc DLPcqsB8VKDLeEMrrhMhEZ4BZYJ3ZHGw5TOZAQIzsvs8yLVeDsYVRKjSxWNxhdgpMu+K HUAHKLZa41g/Y6j4Ro4F5FOp326qkYxBUQoOU3vGCXWGqTS1xZxakJ+U3Iyg5RbAbqbC GTfEGw4QuldTAUId5DBjgA2lSpM5CyUHEozLyWoOf9zSw+yXei/1PpIGzuZeoKxwCg+i xsZeBy8JLyEBhalQ3DrJwevlzlZHSxUjRlsBT5oMICYLORqyL/nYvRTDBZK7co+GDjHK WMPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b="aU/Kjo9i"; dkim=pass header.i=@yandex-team.ru header.s=default header.b="aU/Kjo9i"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3-v6si19813728pgh.385.2018.08.14.02.41.56; Tue, 14 Aug 2018 02:42:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b="aU/Kjo9i"; dkim=pass header.i=@yandex-team.ru header.s=default header.b="aU/Kjo9i"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731556AbeHNM11 (ORCPT + 99 others); Tue, 14 Aug 2018 08:27:27 -0400 Received: from forwardcorp1g.cmail.yandex.net ([87.250.241.190]:55349 "EHLO forwardcorp1g.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728541AbeHNM11 (ORCPT ); Tue, 14 Aug 2018 08:27:27 -0400 Received: from mxbackcorp1g.mail.yandex.net (mxbackcorp1g.mail.yandex.net [IPv6:2a02:6b8:0:1402::301]) by forwardcorp1g.cmail.yandex.net (Yandex) with ESMTP id DAA2F217F2; Tue, 14 Aug 2018 12:40:58 +0300 (MSK) Received: from smtpcorp1p.mail.yandex.net (smtpcorp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:10]) by mxbackcorp1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2h69u6n9wU-ewq8kVxH; Tue, 14 Aug 2018 12:40:58 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1534239658; bh=YxzDZA3Ck/k6jC7qMmngKFEGI7qDuhDO1A2jVGo9ew8=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=aU/Kjo9iUENgyG48ek671T7qR843hOe87O1vNHLbP+KTb7aJyvjMqjevhA20WB2nY mpKFDgZvrZzh5BI7o5Hg5b5c7TK1e4UGqC809AkfGuMjvWV3KB9337uVPXBv//bW5Z 2DIkQ9ME/nYH1MizUaBHMTpI3Kbh8HiUZK88ajIY= Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:854c:7dcd:9203:76a5]) by smtpcorp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Y1n0zZjRFY-ew10394K; Tue, 14 Aug 2018 12:40:58 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1534239658; bh=YxzDZA3Ck/k6jC7qMmngKFEGI7qDuhDO1A2jVGo9ew8=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=aU/Kjo9iUENgyG48ek671T7qR843hOe87O1vNHLbP+KTb7aJyvjMqjevhA20WB2nY mpKFDgZvrZzh5BI7o5Hg5b5c7TK1e4UGqC809AkfGuMjvWV3KB9337uVPXBv//bW5Z 2DIkQ9ME/nYH1MizUaBHMTpI3Kbh8HiUZK88ajIY= Authentication-Results: smtpcorp1p.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: Re: [PATCH RFC 1/3] cgroup: list all subsystem states in debugfs files To: Roman Gushchin , Johannes Weiner Cc: Tejun Heo , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Michal Hocko , Vladimir Davydov References: <153414348591.737150.14229960913953276515.stgit@buzz> <20180813134842.GF3978217@devbig004.ftw2.facebook.com> <20180813171119.GA24658@cmpxchg.org> <20180813175348.GA31962@castle.DHCP.thefacebook.com> From: Konstantin Khlebnikov Message-ID: <1cc17b7b-8f5b-6682-ccc0-19ff5f9992e0@yandex-team.ru> Date: Tue, 14 Aug 2018 12:40:58 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180813175348.GA31962@castle.DHCP.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.08.2018 20:53, Roman Gushchin wrote: > On Mon, Aug 13, 2018 at 01:11:19PM -0400, Johannes Weiner wrote: >> On Mon, Aug 13, 2018 at 06:48:42AM -0700, Tejun Heo wrote: >>> Hello, Konstantin. >>> >>> On Mon, Aug 13, 2018 at 09:58:05AM +0300, Konstantin Khlebnikov wrote: >>>> After removing cgroup subsystem state could leak or live in background >>>> forever because it is pinned by some reference. For example memory cgroup >>>> could be pinned by pages in cache or tmpfs. >>>> >>>> This patch adds common debugfs interface for listing basic state for each >>>> controller. Controller could define callback for dumping own attributes. >>>> >>>> In file /sys/kernel/debug/cgroup/ each line shows state in >>>> format: =... [-- =... ] >>> >>> Seems pretty useful to me. Roman, Johannes, what do you guys think? > > Totally agree with the idea and was about to suggest something similar. > >> Generally I like the idea of having more introspection into offlined >> cgroups, but I wonder if having only memory= and swap= could be a >> little too terse to track down what exactly is pinning the groups. >> >> Roman has more experience debugging these pileups, but it seems to me >> that unless we add a breakdown off memory, and maybe make slabinfo >> available for these groups, that in practice this might not provide >> that much more insight than per-cgroup stat counters of dead children. > > I agree here. I don't think that we could cover all cases with single interface. This debugfs just gives simple entry point for debugging: - paths for guessing user - pointers for looking with gdb via kcore - inode numbers for page-types - see second and third patch For slab: this could show one of remaining slab. Anyway each of them pins css. > > It's hard to say in advance what numbers are useful, so let's export > these numbers, but also make the format more extendable, so we can > easily add new information later. Maybe, something like: > > cgroup { > path = ... > ino = ... > main css { > refcnt = ... > key = value > ... > } > memcg css { > refcnt = ... > ... > } > some other controller css { > } > ... > } > > Also, because we do batch charges, printing numbers without draining stocks > is not that useful. All stats are also per-cpu cached, what adds some > inaccuracy. Seems too verbose. And one-line key=value format is more grep/awk friendly. Anyway such extended debugging could be implemented as gdb plugin. While simple list of pointers gives enough information for dumping structures with gdb alone without extra plugins. > > Thanks! >