Re: [Phishing Risk] [External] Re: [PATCH] cgroup: Add cgroupstats numbers to cgroup.stat file

From: Chengming Zhou
Date: Wed Sep 23 2020 - 05:57:27 EST



在 2020/9/21 下午10:50, Tejun Heo 写道:
> Hello,
>
> On Tue, Sep 15, 2020 at 11:53:49PM +0800, Chengming Zhou wrote:
>> In the cgroup v1, we can use netlink interface to get cgroupstats for
>> a cgroup. But it has been excluded from cgroup v2 interface intentionally
>> due to the duplication and inconsistencies with other statistics.
>> To make container monitor tool like "cadvisor" continue to work, we add
>> these cgroupstats numbers to the cgroup.stat file, and change the
>> admin-guide doc accordingly.
> So, we can't add O(nr_threads) operations to cgroup.stat reads. There are
> two ways forward that I can see.
>
> * Investigate how these counters are being used. If it's used for congestion
> detection, pressure metrics are likely better indicators to use anyway. If
> the usage frequency is low enough, maybe querying from userspace should
> work?
>
> * If the need for these per-cgroup task state counters is really
> justifiable, the counters should be maintained from scheduling event
> directly and summed up using rstat like other statistics.
>
> Thanks.
>
Well, I see. These counters are being used for load monitor and debug,
pressure metrics

is good for congestion detection, but more details needed for debug when
problem happened.

And I noticed PSI has maintained these taskstats from scheduler event
already. I think we can

just export these counters gracefully.

Thanks.