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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBD5BECAAD6 for ; Fri, 26 Aug 2022 07:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245229AbiHZHiY (ORCPT ); Fri, 26 Aug 2022 03:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244859AbiHZHiW (ORCPT ); Fri, 26 Aug 2022 03:38:22 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 083C81E3E7; Fri, 26 Aug 2022 00:38:22 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B90F433687; Fri, 26 Aug 2022 07:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1661499500; h=from:from:reply-to: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=RtYcNt5XkJRCJhjOhp/OsUYuN7jr0K2tW7LntfrhxP0=; b=I83xBB1b8caTVTsQfISvp8FIA6foX4NceUMAUYAmwPJBwHop0a0Gzweik2JXe457EyMmtN lSClOj6h8yDjeJxxWe7yi6oWSwq5m/lU52xMew9cIuPfHGqSESJsh2j1xWq98TMK759ova nDVuukr7lE2gmxo6ybIB1sxADXm6izM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9786513421; Fri, 26 Aug 2022 07:38:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BYD3Imx4CGOxEQAAMHmgww (envelope-from ); Fri, 26 Aug 2022 07:38:20 +0000 Date: Fri, 26 Aug 2022 09:38:19 +0200 From: Michal Hocko To: Lu Jialin Cc: Zefan Li , Tejun Heo , Johannes Weiner , Andrew Morton , Roman Gushchin , Shakeel Butt , Muchun Song , Xiu Jianfeng , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC 2/2] memcg: Adapt cgroup.top into per-memcg Message-ID: References: <20220826011503.103894-1-lujialin4@huawei.com> <20220826011503.103894-3-lujialin4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220826011503.103894-3-lujialin4@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 26-08-22 09:15:03, Lu Jialin wrote: > cgroup.top is able to show resource usage information for each cgroups. > Currently only memory usage is monitored ,including usage,anon,file, > kmem(Bytes), stats for other resource types would be added as well. > > Show case: > / # mount -t cgroup2 none /sys/fs/cgroup > / # cd /sys/fs/cgroup/ > /sys/fs/cgroup # echo "+memory" > cgroup.subtree_control > /sys/fs/cgroup # mkdir test1 > /sys/fs/cgroup # mkdir test2 > /sys/fs/cgroup # mkdir test3 > /sys/fs/cgroup # echo $$ > test2/cgroup.procs > /sys/fs/cgroup # cd /test > /test # ./memcg_malloc 512000 & > /test # ./memcg_malloc 512000 & > /test # ./memcg_malloc 512000 & > /test # cd /sys/fs/cgroup > /sys/fs/cgroup # echo $$ > test1/cgroup.procs > /sys/fs/cgroup # cd /test > /test # ./memcg_malloc 512000 & > /test # cd /sys/fs/cgroup > /sys/fs/cgroup # echo $$ > test3/cgroup.procs > /sys/fs/cgroup # cat cgroup.top > memory top: > name usage anon file kernel > test2 1974272 1671168 0 270336 > test1 700416 569344 0 94208 > test3 196608 86016 0 86016 This information is already present in memory.stat and can be easily post-processed to generate similar output. Why is that insufficient? -- Michal Hocko SUSE Labs