Skip to content

Commit

Permalink
cgroup_fj_stress: Avoid killall and kill separately
Browse files Browse the repository at this point in the history
We discovered problems that killall didn't catched all processes. With
this patch, we collect the pids manually and kill them sequential.
  • Loading branch information
cfconrad committed Nov 5, 2019
1 parent 0807a82 commit ac91d4c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh
Expand Up @@ -74,6 +74,7 @@ setup
export TMPFILE=./tmp_tasks.$$

count=0
collected_pids=""

build_subgroups()
{
Expand Down Expand Up @@ -107,6 +108,7 @@ attach_task()
if [ -z "$ppid" ]; then
cgroup_fj_proc&
pid=$!
collected_pids="$collected_pids $pid";
else
pid="$ppid"
fi
Expand Down Expand Up @@ -148,9 +150,10 @@ case $attach_operation in
"each" )
tst_resm TINFO "Attaching task to each subgroup"
attach_task "$start_path" 0
ROD killall -9 "cgroup_fj_proc"
# Wait for attached tasks to terminate
wait
for pid in $collected_pids; do
ROD kill -9 "$pid"
wait "$pid"
done
;;
* )
;;
Expand Down

0 comments on commit ac91d4c

Please sign in to comment.