Re: [dpdk-dev] [PATCH] test: make hugepage check more robust under Linux
From: Aaron Conole <aconole@redhat.com>
Date: 2021-03-19 14:34:16
David Marchand [off-list ref] writes:
On Wed, Mar 17, 2021 at 3:44 PM Aaron Conole [off-list ref] wrote:quoted
diff --git a/app/test/has-hugepage.sh b/app/test/has-hugepage.sh index d600fad319..1c3cfb665a 100755 --- a/app/test/has-hugepage.sh +++ b/app/test/has-hugepage.sh@@ -3,7 +3,17 @@ # Copyright 2020 Mellanox Technologies, Ltd if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 + nr_hugepages=$(cat /proc/sys/vm/nr_hugepages) + # Need to check if we have permissions to access hugepages + perm="" + for mount in `mount | grep hugetlbfs | awk '{ print $3; }'`; do + test ! -w $mount/. || perm="$mount" + done + if [ "$perm" = "" -o "$nr_hugepages" = "0" ]; then + echo 0 + else + echo $nr_hugepages + fi elif [ "$(uname)" = "FreeBSD" ] ; then echo 1 # assume FreeBSD always has hugepages elseThe check is evaluated first when configuring as normal user and not reevaluated when running the tests as root in Travis/GHA, so the tests are started with no hugepage. Then, in Travis and GHA, we can see (sigbus o_O) crashes in no-huge mode. I tried to reproduce but did not manage.
I noticed that as well. I am equally as confused, but I'm working on it (along with folding in Thomas' suggestions).