Skip to contentSkip to conversation

selftests/thuge-gen: Use platform specific MAP_HUGETLB value

PATCH New Helge Deller 1 participant 1 message Mar 31, 2016 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/thuge-gen: Use platform specific MAP_HUGETLB value

Do not hardcode MAP_HUGETLB to 0x40000, since quite some architectures use a different value.

Tested with a parisc architecture 64bit kernel.

tools/testing/selftests/vm/thuge-gen.c +2 -0
index c879572..0bc737a 100644
@@ -30,7 +30,9 @@
 #define MAP_HUGE_1GB    (30 << MAP_HUGE_SHIFT)
 #define MAP_HUGE_SHIFT  26
 #define MAP_HUGE_MASK   0x3f
+#if !defined(MAP_HUGETLB)
 #define MAP_HUGETLB	0x40000
+#endif
 
 #define SHM_HUGETLB     04000   /* segment will use huge TLB pages */
 #define SHM_HUGE_SHIFT  26