test/scheduler: Create unique list of existing cgroups prior moving them
Since multiple processes may belong to the same cgroup, this will make sure we don't call move_cgroup_procs() against single cgroup multiple times. Signed-off-by: Michal Berger <michallinuxstuff@gmail.com> Change-Id: I64d12e5ac8e9c628ff7556b566f2090c965ab35a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11671 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
f8f9b01d97
commit
a9614bf6e7
@ -12,6 +12,7 @@ check_cgroup() {
|
|||||||
|
|
||||||
init_cpuset_cgroup() {
|
init_cpuset_cgroup() {
|
||||||
local cgroup
|
local cgroup
|
||||||
|
local -A cgroups=()
|
||||||
|
|
||||||
# For cgroup-v2 we need to prepare cpuset subsystem on our own
|
# For cgroup-v2 we need to prepare cpuset subsystem on our own
|
||||||
if ((cgroup_version == 2)); then
|
if ((cgroup_version == 2)); then
|
||||||
@ -29,8 +30,11 @@ init_cpuset_cgroup() {
|
|||||||
cgroup=$(< "$cgroup") || continue
|
cgroup=$(< "$cgroup") || continue
|
||||||
cgroup=${cgroup##*:}
|
cgroup=${cgroup##*:}
|
||||||
[[ $cgroup != / ]] || continue
|
[[ $cgroup != / ]] || continue
|
||||||
move_cgroup_procs "${cgroup##*:}" /
|
cgroups["$cgroup"]=$cgroup
|
||||||
done 2> /dev/null
|
done 2> /dev/null
|
||||||
|
for cgroup in "${!cgroups[@]}"; do
|
||||||
|
move_cgroup_procs "$cgroup" /
|
||||||
|
done
|
||||||
# Now, move all the threads to the cpuset
|
# Now, move all the threads to the cpuset
|
||||||
move_cgroup_procs / /cpuset
|
move_cgroup_procs / /cpuset
|
||||||
elif ((cgroup_version == 1)); then
|
elif ((cgroup_version == 1)); then
|
||||||
|
Loading…
Reference in New Issue
Block a user