umber-kernel/tools/testing/selftests
Li Wang ca666795bd selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs
[ Upstream commit 1aa1dd9cc595917882fb6db67725442956f79607 ]

charge_reserved_hugetlb.sh mounts a hugetlbfs instance at /mnt/huge with a
fixed size of 256M.  On systems with large base hugepages (e.g.  512MB),
this is smaller than a single hugepage, so the hugetlbfs mount ends up
with zero capacity (often visible as size=0 in mount output).

As a result, write_to_hugetlbfs fails with ENOMEM and the test can hang
waiting for progress.

=== Error log ===
  # uname -r
  6.12.0-xxx.el10.aarch64+64k

  #./charge_reserved_hugetlb.sh -cgroup-v2
  # -----------------------------------------
  ...
  # nr hugepages = 10
  # writing cgroup limit: 5368709120
  # writing reseravation limit: 5368709120
  ...
  # write_to_hugetlbfs: Error mapping the file: Cannot allocate memory
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  ...

  # mount |grep /mnt/huge
  none on /mnt/huge type hugetlbfs (rw,relatime,seclabel,pagesize=512M,size=0)

  # grep -i huge /proc/meminfo
  ...
  HugePages_Total:      10
  HugePages_Free:       10
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  Hugepagesize:     524288 kB
  Hugetlb:         5242880 kB

Drop the mount args with 'size=256M', so the filesystem capacity is sufficient
regardless of HugeTLB page size.

Link: https://lkml.kernel.org/r/20251221122639.3168038-3-liwang@redhat.com
Fixes: 29750f71a9 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")
Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-04 07:21:10 -05:00
..
acct
alsa
amd-pstate
arm64
bpf selftests/bpf: Test bpf_skb_check_mtu(BPF_MTU_CHK_SEGS) when transport_header is not set 2026-02-26 14:59:47 -08:00
breakpoints
cachestat selftests: cachestat: Fix warning on declaration under label 2025-10-22 09:23:18 -06:00
capabilities
cgroup
clone3
connector
core
coredump
cpu-hotplug
cpufreq
damon
devices
dma
dmabuf-heaps
drivers selftests: netconsole: Increase port listening timeout 2026-02-26 14:59:38 -08:00
dt
efivarfs
exec
fchmodat2
filelock
filesystems
firmware
fpu
ftrace selftests/ftrace: traceonoff_triggers: strip off names 2026-01-08 10:16:52 +01:00
futex
gpio
hid
ia64
intel_pstate
iommu iommufd/selftest: Make it clearer to gcc that the access is not out of bounds 2026-01-02 12:56:48 +01:00
ipc
ir
kcmp
kexec
kho
kmod
kselftest
kselftest_harness
kvm KVM: selftests: Add -U_FORTIFY_SOURCE to avoid some unpredictable test failures 2026-02-11 13:41:44 +01:00
landlock selftests/landlock: Properly close a file descriptor 2026-01-23 11:21:22 +01:00
lib
livepatch
lkdtm
locking
lsm
media_tests
membarrier
memfd selftests/memfd: use IPC semaphore instead of SIGSTOP/SIGCONT 2026-02-26 14:59:36 -08:00
memory-hotplug
mincore
mm selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs 2026-03-04 07:21:10 -05:00
module
mount
mount_setattr
move_mount_set_group
mqueue
mseal_system_mappings
namespaces
nci
net selftests: tc_actions: don't dump 2MB of \0 to stdout 2026-02-26 14:59:40 -08:00
nolibc
ntb
openat2
pci_endpoint
pcie_bwctrl
perf_events
pid_namespace
pidfd
power_supply
powerpc
prctl
proc
pstore
ptp
ptrace
rcutorture
resctrl selftests/resctrl: Fix a division by zero error on Hygon 2026-02-26 14:58:57 -08:00
ring-buffer
riscv
rlimits
rseq
rtc
rust
safesetid
sched
sched_ext
seccomp
sgx
signal
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing selftests/tc-testing: Create tests trying to add children to clsact/ingress qdiscs 2025-11-10 16:57:56 -08:00
tdx
thermal/intel
timens
timers
tmpfs
tpm2
tty
turbostat
ublk kselftest/kublk: include message in _Static_assert for C11 compatibility 2026-03-04 07:19:29 -05:00
uevent
user_events selftests/user_events: fix type cast for write_index packed member in perf_test 2025-11-15 10:52:02 -08:00
vDSO
vfio vfio: selftests: replace iova=vaddr with allocated iovas 2025-11-12 08:04:42 -07:00
vsock selftests/vsock: avoid false-positives when checking dmesg 2025-11-06 07:34:50 -08:00
watchdog
wireguard
x86
zram
.gitignore
Makefile
gen_kselftest_tar.sh
kselftest.h
kselftest_deps.sh
kselftest_harness.h
kselftest_install.sh
kselftest_module.h
lib.mk
run_kselftest.sh