Skip to contentSkip to conversation

selftests-mm-fix-khugepaged_race-build-with-older-glibc.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Nov 3

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/mm: fix khugepaged_race build with older glibc
has been removed from the -mm tree. Its filename was
selftests-mm-fix-khugepaged_race-build-with-older-glibc.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Zenghui Yu (Huawei)" <[email protected]>
Subject: selftests/mm: fix khugepaged_race build with older glibc
Date: Tue, 27 Oct 2026 20:20:13 +0800

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")
Cc David Hildenbrand <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>

---

 tools/testing/selftests/mm/khugepaged_race.c |    1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/mm/khugepaged_race.c renamed from tools/testing/selftests/mm/khugepaged_race.c~selftests-mm-fix-khugepaged_race-build-with-older-glibc +1 -0
@@ -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>

_

Patches currently in -mm which might be from [email protected] are

selftests-mm-skip-collapse_compound_extreme-on-thp-allocation-failure.patch mm-page_alloc-remove-unneeded-forward-declaration-of-__free_pages_ok.patch