Files
runc/libcontainer/cgroups
Kir Kolyshkin ed70dfa732 libct/cgroups/v1_utils: implement mountinfo cache
Apparently it is inevitable that we have to read mountinfo multiple
times when dealing with cgroup v1. It seems we can only do it once
and reuse the data, without major modifications to the code.

This commit does a few things.

1. Drop our custom mountinfo parser implementation in favor of
   moby/sys/mountinfo. While the custom parser is faster
   (about 2x according to benchmark) for this particular case,
   the one from the package is more correct and future-proof.

2. Read mountinfo only once, caching all the entries with fstype of
   cgroup.  With this, there's no need to worry about performance
   degradation introduced above.

3. Drop "isSubsystemAvailable" optimization (introduced by commit
   2a1a6cdf44) because now with the cache it is probably slowing
   things down.

4. Modify the tests accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-06 14:54:22 -08:00
..
2020-12-03 08:18:43 -08:00