Skip to content

Commit 0de3103

Browse files
Christian Braunerhtejun
authored andcommitted
tests/cgroup: use cgroup.kill in cg_killall()
If cgroup.kill file is supported make use of it. Link: https://lore.kernel.org/r/[email protected] Cc: Tejun Heo <[email protected]> Cc: [email protected] Reviewed-by: Shakeel Butt <[email protected]> Acked-by: Roman Gushchin <[email protected]> Signed-off-by: Christian Brauner <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 340272b commit 0de3103

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/testing/selftests/cgroup/cgroup_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ int cg_killall(const char *cgroup)
252252
char buf[PAGE_SIZE];
253253
char *ptr = buf;
254254

255+
/* If cgroup.kill exists use it. */
256+
if (!cg_write(cgroup, "cgroup.kill", "1"))
257+
return 0;
258+
255259
if (cg_read(cgroup, "cgroup.procs", buf, sizeof(buf)))
256260
return -1;
257261

0 commit comments

Comments
 (0)