linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/6] tracking fd counts per cgroup
@ 2023-11-08  0:26 Tycho Andersen
  2023-11-08  0:26 ` [RFC 1/6] fs: count_open_files() -> count_possible_open_files() Tycho Andersen
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Tycho Andersen @ 2023-11-08  0:26 UTC (permalink / raw)
  To: cgroups, linux-fsdevel
  Cc: Christian Brauner, Tejun Heo, Zefan Li, Johannes Weiner,
	Haitao Huang, Kamalesh Babulal, Tycho Andersen

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@google.com/

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-11-09 18:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08  0:26 [RFC 0/6] tracking fd counts per cgroup Tycho Andersen
2023-11-08  0:26 ` [RFC 1/6] fs: count_open_files() -> count_possible_open_files() Tycho Andersen
2023-11-08  0:26 ` [RFC 2/6] fs: introduce count_open_files() Tycho Andersen
2023-11-08  0:26 ` [RFC 3/6] misc: introduce misc_cg_charge() Tycho Andersen
2023-11-08  0:26 ` [RFC 4/6] misc cgroup: introduce an fd counter Tycho Andersen
2023-11-08 16:57   ` Al Viro
2023-11-08 21:01     ` Tycho Andersen
2023-11-09  9:53   ` Christian Brauner
2023-11-09 14:58     ` Tycho Andersen
2023-11-08  0:26 ` [RFC 5/6] selftests/cgroup: add a flags arg to clone_into_cgroup() Tycho Andersen
2023-11-08  0:26 ` [RFC 6/6] selftests/cgroup: add a test for misc cgroup Tycho Andersen
2023-11-09 18:44 ` [RFC 0/6] tracking fd counts per cgroup Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).