It's a syntax problem.
man cgset
tells:
SYNOPSIS
cgset [-r <name=value>] <cgroup_path> ...
cgset --copy-from <source_cgroup_path> <cgroup_path> ...
the cgroup_path for your case is /
, not uids:/
. cgset
will silently do nothing and return no error when applied on an non-existing cgroup. This can be verified with strace
(using strace -e trace=open,openat,close,write
):
non-working cgset -r pids.max=max pids:/
:
[...]
openat(AT_FDCWD, "/sys/fs/cgroup/pids/pids:/pids.max", O_RDWR|O_CLOEXEC) = -1 ENOENT (No such file or directory)
+++ exited with 0 +++
working cgset -r pids.max=max /
:
[...]
openat(AT_FDCWD, "/sys/fs/cgroup/pids/pids.max", O_RDWR|O_CLOEXEC) = 3
write(3, "max", 3) = 3
close(3) = 0
+++ exited with 0 +++
Of course you could also write directly from shell to this pseudo-file to do the same, but using sudo
makes it more complicated (eg: having to use the tee
command rather than a shell redirection).