From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Zenghui Yu <zenghui.yu@linux.dev>
Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
david@kernel.org, liam@infradead.org, vbabka@kernel.org,
rppt@kernel.org, surenb@google.com, mhocko@suse.com,
kas@kernel.org
Subject: Re: [PATCH] selftests/mm: fix khugepaged_race build with older glibc
Date: Tue, 27 Oct 2026 12:22:07 +0000 [thread overview]
Message-ID: <auCXZk9g9nFK1Kbs@gremlin> (raw)
In-Reply-To: <20261027122013.4286-1-zenghui.yu@linux.dev>
On Tue, Oct 27, 2026 at 08:20:13PM +0800, Zenghui Yu wrote:
> From: "Zenghui Yu (Huawei)" <zenghui.yu@linux.dev>
>
> glibc versions before 2.37 do not define MADV_COLLAPSE in <sys/mman.h>, so
> khugepaged_race fails to build against them (e.g. glibc 2.34):
>
> [root@localhost mm]# make
> CC khugepaged_race
> khugepaged_race.c: In function 'main':
> khugepaged_race.c:506:23: error: 'MADV_COLLAPSE' undeclared (first use in this function); did you mean 'MADV_COLD'?
> 506 | hpage_pmd_size, MADV_COLLAPSE);
> | ^~~~~~~~~~~~~
> | MADV_COLD
> khugepaged_race.c:506:23: note: each undeclared identifier is reported only once for each function it appears in
> make: *** [../lib.mk:225: /data/code/mm/tools/testing/selftests/mm/khugepaged_race] Error 1
>
> Include <linux/mman.h> to get the UAPI definition of MADV_COLLAPSE.
>
> Fixes: 66c374464438 ("selftests/mm: add khugepaged race harness")
> Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>
Seems sensible enough so:
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> ---
> tools/testing/selftests/mm/khugepaged_race.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/mm/khugepaged_race.c b/tools/testing/selftests/mm/khugepaged_race.c
> index abb0678522cd..1a27cb39745b 100644
> --- a/tools/testing/selftests/mm/khugepaged_race.c
> +++ b/tools/testing/selftests/mm/khugepaged_race.c
> @@ -8,6 +8,7 @@
> #define _GNU_SOURCE
> #include <errno.h>
> #include <fcntl.h>
> +#include <linux/mman.h>
> #include <pthread.h>
> #include <stdio.h>
> #include <stdlib.h>
> --
> 2.56.0
>
--
Cheers, Lorenzo
next prev parent reply other threads:[~2026-10-27 12:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 12:20 Zenghui Yu
2026-10-27 12:22 ` Lorenzo Stoakes (ARM) [this message]
2026-10-27 12:38 ` Kiryl Shutsemau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=auCXZk9g9nFK1Kbs@gremlin \
--to=ljs@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=kas@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=zenghui.yu@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®