Commit f8f9b01d authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/scheduler: Skip process if reading from /proc/pid/cgroup fails



This may happen when given process terminates right after we checked
for existance of the pid/cgroup but before we attempt to read the
file. When read fails, simply skip that process and continue.

Fixes issue #2381

Signed-off-by: default avatarMichal Berger <michallinuxstuff@gmail.com>
Change-Id: Ic859444769d1bfe18cf02bdd23cbef56407289a7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11670


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
parent 0957856d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -26,11 +26,11 @@ init_cpuset_cgroup() {
		# v1, move all the threads from all the existing cgroups to the top
		# cgroup / and then migrate it to the /cpuset we created above.
		for cgroup in /proc/+([0-9])/cgroup; do
			[[ -e $cgroup ]] || continue
			cgroup=$(< "$cgroup") cgroup=${cgroup##*:}
			cgroup=$(< "$cgroup") || continue
			cgroup=${cgroup##*:}
			[[ $cgroup != / ]] || continue
			move_cgroup_procs "${cgroup##*:}" /
		done
		done 2> /dev/null
		# Now, move all the threads to the cpuset
		move_cgroup_procs / /cpuset
	elif ((cgroup_version == 1)); then