Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tests/cgroup: use cgroup.kill in cg_killall()

If cgroup.kill file is supported make use of it.

Link: https://lore.kernel.org/r/20210503143922.3093755-3-brauner@kernel.org
Cc: Tejun Heo <tj@kernel.org>
Cc: cgroups@vger.kernel.org
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Christian Brauner and committed by
Tejun Heo
0de3103f 340272b0

+4
+4
tools/testing/selftests/cgroup/cgroup_util.c
··· 252 252 char buf[PAGE_SIZE]; 253 253 char *ptr = buf; 254 254 255 + /* If cgroup.kill exists use it. */ 256 + if (!cg_write(cgroup, "cgroup.kill", "1")) 257 + return 0; 258 + 255 259 if (cg_read(cgroup, "cgroup.procs", buf, sizeof(buf))) 256 260 return -1; 257 261