Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1021124lqt; Fri, 19 Apr 2024 19:47:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+GrfNAkJ6rze78OhKJ8KEPEaiIZQOWT+kjbhlsEi01hDlQQl5qcPUakOFwEuSerM3TNlKsehEtuMx4JqAhzQOuKbP6dAJL7AHTQA6qg== X-Google-Smtp-Source: AGHT+IGD4A77XIbB7aKCgmtFv0rbs5XXmwFIeFbMuVALeS/lNs0GrtqswqVW/dzaeASOOO0W57lo X-Received: by 2002:a05:620a:4942:b0:78d:74e9:efe7 with SMTP id vz2-20020a05620a494200b0078d74e9efe7mr4264811qkn.74.1713581268467; Fri, 19 Apr 2024 19:47:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713581268; cv=pass; d=google.com; s=arc-20160816; b=UuU0gqvJshVMG0/SwxywTzMdEEubOrp4jKXZAiFf73kwC//f8Q5/LD0vWegG3Jda/6 5SoyERNv330iY3ZyK+coekt1oQRvoNRN8fejttmSifQz2MgmPyijcQXxvUfP+i85a2yK l4TKUzBL+KA4jSDHC3n0BtfOcTAlZ6XG9PX9ms09O4YJJfVeH7qVp+u6GlQD/KselyOR TQfTwCwm/QHj44mAmaBVE6ZLB6ujG/f+h49r5sT+LbfqActUKPdjz7l6/OhM+We245v9 nrSTT+eBvqQSTxqnVJMsgVImcvIb/wsUR/8OCFQTULyexayKfhGieluelAstvmIm2oLr zrjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=xqduuMTC5mZ5wO3H3TGHb58I+WoTLPO51Su8iR6efvk=; fh=iaCZVNyWxsmhJ9RPVcdz/7Pgi6BAUm2U1LqgEAo5DXk=; b=lXCpyd0uro14joUCvM/lb3r5DHiyT9D+wrEYzQfeY5ytIMV1yMywGmRbHLEe7qMKxT gKN7iuIsyX7eY0cAynInyCYjP/lDbK0e/uxxWvgGCwZBryj/rWkHN8gJmoe15q+TSvQa Rp6tv2fzxHgRxfTLO5xQvT23J+s0jye4J8FCf0uZMNonDN2/75kdiaoCBquOSj7leRyz DRVAtZsEQLKOqVDDo0rNm/eW3NJ6SAfm1oG04+HpHDcI4mRClHD6EjgafOn+qwhwmlbA 3LomcF/bgc8QcZCGblP2ygxbY/lIx7qc6fTVGuEY3Sj6qSTYnGKZNR/AdcDiY0nTdF7Q t8dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-152098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dl8-20020a05620a1d0800b0078f1954f1b5si3307879qkb.169.2024.04.19.19.47.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 19:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-152098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 30BCE1C20973 for ; Sat, 20 Apr 2024 02:47:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4DAC79DE; Sat, 20 Apr 2024 02:47:40 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97D77524A; Sat, 20 Apr 2024 02:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713581260; cv=none; b=nBwqJMqfHvFMvQ+a7fy6IlzsKL8+uLmgG8FeLEOPVeghTgiJWsVMb4a+kL9fSI8iP3ZHrfedxS5pETE/oq5ZQbgJbxAxZBeLbddtft30nPCL8b4ATW9hsbSImt/GTuR8tlPORnhveTn5/pFG1CEpI0P1oae0L6CyXC2V1GKGM1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713581260; c=relaxed/simple; bh=aS7AYAhkokyxjMLIzsxuz8z0CxtgKtzwfBkoE/R0NRo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=nXmW24Hj6Lm8OkKF0y8TLX2CySRrrP4VaBnKGI1se1iN9CCJboBG2oDEg49eYlRKCyvFd91SvS+4YOf4dfJPHAYZgKJSjFYbuELqP1mqoso3XSBV6enWv5GUzLwLd0B4EqqNo08BGR97tB31Q8hX3seTyJlBeiNZRyDnHby2mLY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VLwp36cVYzcdqV; Sat, 20 Apr 2024 10:44:27 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id EE61C18006C; Sat, 20 Apr 2024 10:47:33 +0800 (CST) Received: from [10.67.110.112] (10.67.110.112) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Sat, 20 Apr 2024 10:47:33 +0800 Message-ID: Date: Sat, 20 Apr 2024 10:47:33 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] cgroup: make cgroups info more readable To: Huan Yang <11133793@vivo.com>, Huan Yang , Tejun Heo , Zefan Li , Johannes Weiner , , CC: References: <20240409021826.1171921-1-link@vivo.com> <9d01ab99-bbfd-536b-a375-9c44f988aa9a@huawei.com> <945d1e73-21f6-4a56-81ee-9625491f3b26@vivo.com> Content-Language: en-US From: xiujianfeng In-Reply-To: <945d1e73-21f6-4a56-81ee-9625491f3b26@vivo.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500023.china.huawei.com (7.185.36.114) Hi, On 2024/4/19 14:25, Huan Yang wrote: > HI jianfeng > > 在 2024/4/19 11:33, xiujianfeng 写道: >> [Some people who received this message don't often get email from >> xiujianfeng@huawei.com. Learn why this is important at >> https://aka.ms/LearnAboutSenderIdentification ] >> >> Hi, >> >> I found a discussion about this change in the email thread bellow, and >> hope it helps you. > It's helpful to know why this patch not need, thank you. >> >> https://lore.kernel.org/all/YwMwlMv%2FtK3sRXbB@slm.duckdns.org/#t > > I have a question, that, now that only for cgroup1, when I running qemu > ubuntu, I got this: > >> mount | grep cgroup >> cgroup2 on /sys/fs/cgroup type cgroup2 > (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot) > > Only cgroup2 mount in my system, but /proc/cgroup also worked, maybe > better to disable this when only cgroup2 mounted? I’m not the maintainer, so the official answer to this question should be left to them:). However, I don’t think this is the right way. Even though the information shown by /proc/cgroups doesn’t seem as useful for cgroup2 as for cgroup1 due to cgroup2 has only single hierarchy, it’s not entirely useless, IMHO. > >> On 2024/4/9 10:18, Huan Yang wrote: >>> The current cgroups output format is based on tabs, which >>> may cause misalignment of output information. >>> >>> Using placeholder formatting can make the output information >>> more readable. >>> >>> Signed-off-by: Huan Yang >>> --- >>>   kernel/cgroup/cgroup-v1.c | 7 ++++--- >>>   1 file changed, 4 insertions(+), 3 deletions(-) >>> >>> diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c >>> index 520a11cb12f4..c082a78f4c22 100644 >>> --- a/kernel/cgroup/cgroup-v1.c >>> +++ b/kernel/cgroup/cgroup-v1.c >>> @@ -669,15 +669,16 @@ int proc_cgroupstats_show(struct seq_file *m, >>> void *v) >>>        struct cgroup_subsys *ss; >>>        int i; >>> >>> -     seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n"); >>> +     seq_printf(m, "%16s %16s %16s %16s\n", "#subsys_name", >>> "hierarchy", >>> +                "num_cgroups", "enabled"); >>>        /* >>>         * Grab the subsystems state racily. No need to add avenue to >>>         * cgroup_mutex contention. >>>         */ >>> >>>        for_each_subsys(ss, i) >>> -             seq_printf(m, "%s\t%d\t%d\t%d\n", >>> -                        ss->legacy_name, ss->root->hierarchy_id, >>> +             seq_printf(m, "%16s %16d %16d %16d\n", ss->legacy_name, >>> +                        ss->root->hierarchy_id, >>>                           atomic_read(&ss->root->nr_cgrps), >>>                           cgroup_ssid_enabled(i)); >>>