Lines Matching +full:1 +full:- +full:1024
2 # SPDX-License-Identifier: GPL-2.0
4 # Kselftest framework requirement - SKIP code is 4.
7 set -e
9 if [[ $(id -u) -ne 0 ]]; then
17 if [[ "$1" == "-cgroup-v2" ]]; then
18 cgroup2=1
24 CGROUP_ROOT=$(mount -t cgroup2 | head -1 | awk '{print $3}')
25 if [[ -z "$CGROUP_ROOT" ]]; then
26 CGROUP_ROOT=$(mktemp -d)
27 mount -t cgroup2 none $CGROUP_ROOT
28 do_umount=1
32 CGROUP_ROOT=$(mount -t cgroup | grep ",hugetlb" | awk '{print $3}')
33 if [[ -z "$CGROUP_ROOT" ]]; then
35 mount -t cgroup memory,hugetlb $CGROUP_ROOT
36 do_umount=1
42 hpz=$(grep -i hugepagesize /proc/meminfo)
43 kb=${hpz:14:-3}
44 mb=$(($kb / 1024))
53 rm -rf "$MNT"/* 2>/dev/null
60 set -e
64 local actual_path="$1"
66 local tolerance=$((7 * 1024 * 1024))
68 local interval=1
79 if [[ $actual -ge $(($expected - $tolerance)) ]] &&
80 [[ $actual -le $(($expected + $tolerance)) ]]; then
85 elapsed=$((now - start_time))
87 if [[ $elapsed -ge $timeout ]]; then
88 echo "actual = $((${actual%% *} / 1024 / 1024)) MB"
89 echo "expected = $((${expected%% *} / 1024 / 1024)) MB"
91 exit 1
99 local expected_a="$1"
104 if [ ! -z ${3:-} ] && [ ! -z ${4:-} ]; then
112 if [[ -n "$expected_b" && -n "$expected_b_hugetlb" ]]; then
121 sleep 1
136 mkdir -p "$MNT"
137 mount -t hugetlbfs none "$MNT"
141 local cgroup="$1"
152 ./write_to_hugetlbfs -p "$path" -s "$size" -m 0 -o
161 set -e
163 size=$((${MB} * 1024 * 1024 * 25)) # 50MB = 25 * 2MB hugepages.
181 rm -rf /mnt/huge/*
206 rm -rf "$MNT"/*
229 rm -rf "$MNT"/*
240 rm -rf $CGROUP_ROOT