If you a sysadmin, chances are high you’ve seen a very slow ps or non-working top. If you are a developer trying to parse /proc/pid/* files, you know it’s a mess. While developing and using OpenVZ and CRIU, we feel this pain too, so we found a way to cure it!
This talk presents a new Linux Kernel interface to collect information about processes, named task-diag. It discusses multiple shortcomings of the current interface, and shows how the new one avoids those.
In particular, task-diag employs binary format, and uses flexible means to specify which kinds of information and for which tasks is required. Modelled after sock-diag, it uses the request-response model and netlink message format. Tests of the new interface (using modified procps utilities) demonstrate up to 10x speedup. Other users of the new API, notably CRIU and perf, also proved it is fast and viable.