[LTP] [PATCH v5 4/7] Add new CGroups API library tests
Cyril Hrubis
chrubis@suse.cz
Fri Apr 30 17:57:59 CEST 2021
Hi!
> + SAFE_CGROUP_PRINTF(cg, "memory.max", "%zu", (1UL << 24) - 1);
> + SAFE_CGROUP_PRINTF(cg_child, "cgroup.procs", "%d", getpid());
> + SAFE_CGROUP_SCANF(cg, "memory.current", "%zu", &mem);
> + tst_res(TPASS, "memory.current = %zu", mem);
> +
> + tst_reap_children();
> + SAFE_CGROUP_PRINTF(cg_drain, "cgroup.procs", "%d", getpid());
> + cg_child = tst_cgroup_group_rm(cg_child);
I'm not sure that we want to cleanup the pointer like this, the more
usuall way would be passing &cg_child to the function, but this is very
minor.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list