From c0648d4b451d5d1c4cde5e40933cf64723b89087 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 10 Nov 2020 11:07:47 +0100 Subject: [PATCH] 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: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5065 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki Reviewed-by: Karol Latecki Reviewed-by: Jim Harris --- scripts/setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 9f13dea19..f8deba0a4 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -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* }