[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5F7011AF-8CC2-45E0-A226-273261856FF0@nvidia.com>
Date: Fri, 05 Sep 2025 13:55:53 -0400
From: Zi Yan <ziy@...dia.com>
To: Mark Brown <broonie@...nel.org>
Cc: Usama Arif <usamaarif642@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>, david@...hat.com,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org, corbet@....net,
rppt@...nel.org, surenb@...gle.com, mhocko@...e.com, hannes@...xchg.org,
baohua@...nel.org, shakeel.butt@...ux.dev, riel@...riel.com,
laoar.shao@...il.com, dev.jain@....com, baolin.wang@...ux.alibaba.com,
npache@...hat.com, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
ryan.roberts@....com, vbabka@...e.cz, jannh@...gle.com,
Arnd Bergmann <arnd@...db.de>, sj@...nel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, kernel-team@...a.com, Aishwarya.TCV@....com
Subject: Re: [PATCH v5 6/7] selftests: prctl: introduce tests for disabling
THPs completely
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
Powered by blists - more mailing lists