On 5 Sep 2025, at 13:43, Mark Brown wrote: > On Fri, Aug 15, 2025 at 02:54:58PM +0100, Usama Arif wrote: >> The test will set the global system THP setting to never, madvise >> or always depending on the fixture variant and the 2M setting to >> inherit before it starts (and reset to original at teardown). >> The fixture setup will also test if PR_SET_THP_DISABLE prctl call can >> be made to disable all THPs and skip if it fails. > > I don't think this is an issue in this patch but with it we're seeing > build failures in -next on arm64 with: > > make KBUILD_BUILD_USER=KernelCI FORMAT=.xz ARCH=arm64 HOSTCC=gcc CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- CC="ccache aarch64-linux-gnu-gcc" O=/tmp/kci/linux/build -C/tmp/kci/linux -j98 kselftest-gen_tar > > ... > > CC prctl_thp_disable > prctl_thp_disable.c: In function ‘test_mmap_thp’: > prctl_thp_disable.c:64:39: error: ‘MADV_COLLAPSE’ undeclared (first use in this function); did you mean ‘MADV_COLD’? > 64 | madvise(mem, pmdsize, MADV_COLLAPSE); > | ^~~~~~~~~~~~~ > | MADV_COLD > > since the headers_install copy of asm-generic/mman-common.h doesn't > appear to being picked up with the above build invocation (most others > are fine). I'm not clear why, it looks like an appropriate -isystem > ends up getting passed to the compiler: > > aarch64-linux-gnu-gcc -Wall -O2 -I /linux/tools/testing/selftests/../../.. -isystem /tmp/kci/linux/build/usr/include -isystem /linux/tools/testing/selftests/../../../tools/include/uapi -U_FORTIFY_SOURCE -D_GNU_SOURCE= prctl_thp_disable.c vm_util.c thp_settings.c -lrt -lpthread -lm -o /tmp/kci/linux/build/kselftest/mm/prctl_thp_disable > > but the header there is getting ignored AFAICT. Probably the problem is > fairly obvious and I'm just being slow - I'm not quite 100% at the > minute. prctl_thp_disable.c uses “#include <sys/mman.h>” but asm-generic/mman-common.h is included in asm/mman.h. And sys/mman.h gets MADV_COLLAPSE from bits/mman-linux.h. Maybe that is why? > > Thanks to Aishwarya for confirming which patch triggered the issue. Best Regards, Yan, Zi