From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Brauner Subject: Re: [PATCH v2 5/5] tests/cgroup: test cgroup.kill Date: Wed, 5 May 2021 20:52:24 +0200 Message-ID: <20210505185224.zjfunx5wetgp6a2f@wittgenstein> References: <20210503143922.3093755-1-brauner@kernel.org> <20210503143922.3093755-5-brauner@kernel.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Shakeel Butt Cc: Christian Brauner , Tejun Heo , Roman Gushchin , Zefan Li , Johannes Weiner , Cgroups , containers-cunTk1MwBs/YUNznpcFYbw@public.gmane.org On Wed, May 05, 2021 at 11:34:41AM -0700, Shakeel Butt wrote: > On Mon, May 3, 2021 at 7:40 AM Christian Brauner wrote: > > > [...] > > + > > +static int test_cgkill_simple(const char *root) > > +{ > > + pid_t pids[100]; > > + int ret = KSFT_FAIL; > > + char *cgroup = NULL; > > + int i; > > + > > + cgroup = cg_name(root, "cg_test_simple"); > > + if (!cgroup) > > + goto cleanup; > > + > > + if (cg_create(cgroup)) > > + goto cleanup; > > + > > + for (i = 0; i < 100; i++) > > + pids[i] = cg_run_nowait(cgroup, child_fn, NULL); > > + > > + if (cg_wait_for_proc_count(cgroup, 100)) > > + goto cleanup; > > + > > + if (cg_write(cgroup, "cgroup.kill", "1")) > > + goto cleanup; > > I don't think the above write to cgroup.kill is correct. Hm, that's a left-over from the port of the similar freezer test. Thanks for spotting this. It never failed because of the number of procs being created and then killed most likely. Thanks, will remove. Christian