Hi all, At Netflix, we have a "canary" framework that will run test versions of an application and automatically detect anomalies in various metrics. We also have two "fleets", one full of virtual machines, and one that is a multi-tenant container environment. On our full-VM fleet, one of the metrics we analyze is the number of open file descriptors, from /proc/sys/fs/file-nr. However, no equivalent exists for the multi-tenant container fleet, which has lead to several production issues. This idea is not new of course [1], but hopefully the existence of the new misc cgroup will make it more tenable. I'm not really tied to any of the semantics in this series (e.g. threads could be double counted even with a shared table), and am open to implementing this in other ways if it makes more sense. Thoughts welcome, Tycho [1]: https://lore.kernel.org/all/1404311407-4851-1-git-send-email-merimus@xxxxxxxxxx/ Tycho Andersen (6): fs: count_open_files() -> count_possible_open_files() fs: introduce count_open_files() misc: introduce misc_cg_charge() misc cgroup: introduce an fd counter selftests/cgroup: add a flags arg to clone_into_cgroup() selftests/cgroup: add a test for misc cgroup fs/file.c | 82 +++- include/linux/fdtable.h | 6 + include/linux/misc_cgroup.h | 2 + kernel/cgroup/misc.c | 232 ++++++++++- tools/testing/selftests/cgroup/.gitignore | 1 + tools/testing/selftests/cgroup/Makefile | 2 + tools/testing/selftests/cgroup/cgroup_util.c | 8 +- tools/testing/selftests/cgroup/cgroup_util.h | 2 +- tools/testing/selftests/cgroup/test_core.c | 4 +- tools/testing/selftests/cgroup/test_misc.c | 385 +++++++++++++++++++ 10 files changed, 712 insertions(+), 12 deletions(-) create mode 100644 tools/testing/selftests/cgroup/test_misc.c base-commit: 13d88ac54ddd1011b6e94443958e798aa06eb835 -- 2.34.1