Bug 200593

Summary: Delay accounting in cgroups
Product: Process Management Reporter: Ivan Babrou (ibobrik)
Component: OtherAssignee: process_other
Status: NEW ---    
Severity: normal CC: kernel
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.14.56 Subsystem:
Regression: No Bisected commit-id:

Description Ivan Babrou 2018-07-18 22:03:14 UTC
Currently it's possible to get task delay accounting:

* https://github.com/torvalds/linux/blob/master/Documentation/accounting/delay-accounting.txt

It's possible with either /proc/<pid>/schedstat or with getdelays program:

* https://github.com/torvalds/linux/blob/master/tools/accounting/getdelays.c

While cgroups are great for getting cpu, memory and block IO usage, they do not have delay accounting yet. Tools like cAdvisor have to iterate individual processes in cgroups to accumulate totals. Dying processes reset counters and skew the resulting data:

* https://github.com/google/cadvisor/pull/1872#issuecomment-402326304

I suggest to expose delay accounting the same way cpu stats are exposed in cgroups: as aggregate counters.