[dpdk-dev] [PATCH] test: make hugepage check more robust under Linux
Thomas Monjalon
thomas at monjalon.net
Wed Mar 17 15:57:31 CET 2021
17/03/2021 15:44, Aaron Conole:
> The hugepage test really needs to check multiple things on Linux:
>
> 1. Are hugepages reserved in the system?
>
> 2. Is the hugepage mountpoint available so that we can allocate them?
>
> 3. Do we have permissions to write into the hugepage mountpoint?
>
> The existing hugepage check only verifies the first. On some setups,
> a non-root user won't have access to the mountpoint for hugepages to
> be allocated and that needs to be reflected in the test as well. Add
> such checks for Linux OS to give a more check when running test suites.
Requirements 2 & 3 are optional.
You don't need a mount point if using the option --in-memory.
[...]
> + perm=""
perm= should do the same.
> + for mount in `mount | grep hugetlbfs | awk '{ print $3; }'`; do
Please prefer $() syntax.
Are spaces in awk required?
> + test ! -w $mount/. || perm="$mount"
Why /. ?
> + done
> + if [ "$perm" = "" -o "$nr_hugepages" = "0" ]; then
= "" can be replaced with -z
"0" can be simply 0
> + echo 0
> + else
> + echo $nr_hugepages
> + fi
More information about the dev
mailing list