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

scripts/setup: Check if hugepage files are used before removal



If DPDK was not told to unlink the hugepage backing files during the
hugepage_init, the application will keep them open while holding a
lock on each file. Check if said lock is held, if not, remove the
file.

Change-Id: I738a3d7756c335b63388a2efeb03debd734d9c9e
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5065


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent bcf9f8ff
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -533,7 +533,9 @@ function reset_linux_pci() {
function reset_linux() {
	reset_linux_pci
	for mount in $(linux_hugetlbfs_mounts); do
		rm -f "$mount"/spdk*map_*
		for hp in "$mount"/spdk*map_*; do
			flock -n "$hp" true && rm -f "$hp"
		done
	done
	rm -f /run/.spdk*
}