Skip to contentSkip to conversation

cpuset_memory: Fix hugetlb mntpoint

PATCH In review Martin Doucha 3 participants 3 messages Mar 24 – Mar 26

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuset_memory: Fix hugetlb mntpoint

The cpuset_memory test tries to mount hugetlb filesystem on a hardcoded directory in the root filesystem. This doesn't work on distros with read-only root. Change the mountpoint to the common temp directory instead.

---

Tested on SLE-Micro 6.

 .../cpuset/cpuset_memory_test/cpuset_memory_testset.sh   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh +5 -4
index d63950f8e..581df5c32 100755
@@ -44,6 +44,7 @@ HUGEPAGESIZE=$(awk '/Hugepagesize/{ print $2 }' /proc/meminfo)
 HUGEPAGESIZE=$((${HUGEPAGESIZE:-0} * 1024))
 
 MEMORY_RESULT="$CPUSET_TMP/memory_result"
+HUGETLB_MNTPOINT="$CPUSET_TMP/hugetlb"
 
 # simple_getresult
 # $1 - cpuset_memory_test's pid
@@ -181,8 +182,8 @@ test6()
 		return 0
 	fi
 
-	mkdir /hugetlb
-	mount -t hugetlbfs none /hugetlb
+	mkdir "$HUGETLB_MNTPOINT"
+	mount -t hugetlbfs none "$HUGETLB_MNTPOINT"
 
 	save_nr_hugepages=$(cat /proc/sys/vm/nr_hugepages)
 	echo $((2*$nr_mems)) > /proc/sys/vm/nr_hugepages
@@ -190,8 +191,8 @@ test6()
 	cpuset_memory_test --shm --hugepage -s $HUGEPAGESIZE --key=7 >"$MEMORY_RESULT" &
 	simple_getresult $! "$CPUSET/0"
 
-	umount /hugetlb
-	rmdir /hugetlb
+	umount "$HUGETLB_MNTPOINT"
+	rmdir "$HUGETLB_MNTPOINT"
 
 	echo $save_nr_hugepages > /proc/sys/vm/nr_hugepages
 	if [ $(cat /proc/sys/vm/nr_hugepages) -ne $save_nr_hugepages ]; then
Signature · 5 lines
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
In reply to Martin Doucha

Hi Martin,

Quoted 9 lines

The cpuset_memory test tries to mount hugetlb filesystem on a hardcoded directory in the root filesystem. This doesn't work on distros with read-only root. Change the mountpoint to the common temp directory instead.

---

Tested on SLE-Micro 6.

good catch, thank you! Merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp