Skip to content

Commit

Permalink
cpuset_memory_testset.sh: Fix syntax error when hugepages not supported
Browse files Browse the repository at this point in the history
The initial hugepage size calculation can result in multiplication
of empty string on machines which don't support hugepages. Make
sure that empty string is converted to zero.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Li Wang <liwang@redhat.com>
  • Loading branch information
mdoucha authored and wangli5665 committed Jul 20, 2023
1 parent 90a1b10 commit c87178e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mems_all="$(seq -s, 0 $((nr_mems-1)))"
cpu_of_node0=0

HUGEPAGESIZE=$(awk '/Hugepagesize/{ print $2 }' /proc/meminfo)
HUGEPAGESIZE=$(($HUGEPAGESIZE * 1024))
HUGEPAGESIZE=$((${HUGEPAGESIZE:-0} * 1024))

MEMORY_RESULT="$CPUSET_TMP/memory_result"

Expand Down

0 comments on commit c87178e

Please sign in to comment.