[dpdk-dev] [PATCH] test: make hugepage check more robust under Linux

David Marchand david.marchand at redhat.com
Fri Mar 19 14:41:12 CET 2021


On Wed, Mar 17, 2021 at 3:44 PM Aaron Conole <aconole at redhat.com> wrote:
> 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
>  else

The 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.


-- 
David Marchand



More information about the dev mailing list