This is an updated patchset rebasing onto -torvalds master (post 6.11-rc1), and addressing comments from Michal and Tejun.
As requested by Tejun and Johannes, I've removed the explicit check for the string "reset", so it now allows any non-empty string. (Empty strings get filtered before our write handler executes)
I've also made several of the field reads and writes atomic with {READ,WRITE}_ONCE, and adjusted more of the types to be unsigned.
Documentation/admin-guide/cgroup-v2.rst | 22 ++-- include/linux/cgroup-defs.h | 5 + include/linux/cgroup.h | 3 + include/linux/memcontrol.h | 5 + include/linux/page_counter.h | 11 +- kernel/cgroup/cgroup-internal.h | 2 + kernel/cgroup/cgroup.c | 7 + mm/memcontrol.c | 116 +++++++++++++++-- mm/page_counter.c | 30 +++-- tools/testing/selftests/cgroup/cgroup_util.c | 22 ++++ tools/testing/selftests/cgroup/cgroup_util.h | 2 + tools/testing/selftests/cgroup/test_memcontrol.c | 229 +++++++++++++++++++++++++++++++-- 12 files changed, 419 insertions(+), 35 deletions(-)
[1]: https://lore.kernel.org/cgroups/20240724161942.3448841-3-davidf@vimeo.com/T/