Skip to content

Commit bbe246f

Browse files
juntongdengakpm00
authored andcommitted
selftests/mm: fix awk usage in charge_reserved_hugetlb.sh and hugetlb_reparenting_test.sh that may cause error
According to the awk manual, the -e option does not need to be specified in front of 'program' (unless you need to mix program-file). The redundant -e option can cause error when users use awk tools other than gawk (for example, mawk does not support the -e option). Error Example: awk: not an option: -e Link: https://lkml.kernel.org/r/VI1P193MB075228810591AF2FDD7D42C599C3A@VI1P193MB0752.EURP193.PROD.OUTLOOK.COM Signed-off-by: Juntong Deng <[email protected]> Cc: Shuah Khan <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2452626 commit bbe246f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/testing/selftests/mm/charge_reserved_hugetlb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ if [[ "$1" == "-cgroup-v2" ]]; then
2525
fi
2626

2727
if [[ $cgroup2 ]]; then
28-
cgroup_path=$(mount -t cgroup2 | head -1 | awk -e '{print $3}')
28+
cgroup_path=$(mount -t cgroup2 | head -1 | awk '{print $3}')
2929
if [[ -z "$cgroup_path" ]]; then
3030
cgroup_path=/dev/cgroup/memory
3131
mount -t cgroup2 none $cgroup_path
3232
do_umount=1
3333
fi
3434
echo "+hugetlb" >$cgroup_path/cgroup.subtree_control
3535
else
36-
cgroup_path=$(mount -t cgroup | grep ",hugetlb" | awk -e '{print $3}')
36+
cgroup_path=$(mount -t cgroup | grep ",hugetlb" | awk '{print $3}')
3737
if [[ -z "$cgroup_path" ]]; then
3838
cgroup_path=/dev/cgroup/memory
3939
mount -t cgroup memory,hugetlb $cgroup_path

tools/testing/selftests/mm/hugetlb_reparenting_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ fi
2020

2121

2222
if [[ $cgroup2 ]]; then
23-
CGROUP_ROOT=$(mount -t cgroup2 | head -1 | awk -e '{print $3}')
23+
CGROUP_ROOT=$(mount -t cgroup2 | head -1 | awk '{print $3}')
2424
if [[ -z "$CGROUP_ROOT" ]]; then
2525
CGROUP_ROOT=/dev/cgroup/memory
2626
mount -t cgroup2 none $CGROUP_ROOT
2727
do_umount=1
2828
fi
2929
echo "+hugetlb +memory" >$CGROUP_ROOT/cgroup.subtree_control
3030
else
31-
CGROUP_ROOT=$(mount -t cgroup | grep ",hugetlb" | awk -e '{print $3}')
31+
CGROUP_ROOT=$(mount -t cgroup | grep ",hugetlb" | awk '{print $3}')
3232
if [[ -z "$CGROUP_ROOT" ]]; then
3333
CGROUP_ROOT=/dev/cgroup/memory
3434
mount -t cgroup memory,hugetlb $CGROUP_ROOT

0 commit comments

Comments
 (0)