hugetlb: migrate library and numa helpers to libs/
PATCH 1/1 hugetlb: migrate library and numa helpers to libs/
--- .../lib/hugetlb.h => include/tst_hugetlb.h | 8 +- include/tst_numa.h | 9 +++ libs/hugetlb/Makefile | 8 ++ .../hugetlb.c => libs/hugetlb/libhugetlb.c | 10 +-- libs/numa/tst_numa.c | 79 ++++++++++++++++--- testcases/kernel/include/numa_helper.h | 2 +- testcases/kernel/lib/numa_cpuset.c | 64 --------------- testcases/kernel/mem/hugetlb/Makefile | 28 ++----- testcases/kernel/mem/hugetlb/Makefile.inc | 24 +++--- .../hugetlb/hugefallocate/hugefallocate01.c | 2 +- .../hugetlb/hugefallocate/hugefallocate02.c | 2 +- .../kernel/mem/hugetlb/hugefork/hugefork01.c | 2 +- .../kernel/mem/hugetlb/hugefork/hugefork02.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap01.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap02.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap04.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap05.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap06.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap07.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap08.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap09.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap10.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap11.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap12.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap13.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap14.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap15.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap16.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap17.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap18.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap19.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap20.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap21.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap22.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap23.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap24.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap25.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap26.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap27.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap28.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap29.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap30.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap31.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap32.c | 2 +- .../kernel/mem/hugetlb/hugemmap/hugemmap34.c | 2 +- .../mem/hugetlb/hugeshmat/hugeshmat01.c | 2 +- .../mem/hugetlb/hugeshmat/hugeshmat02.c | 2 +- .../mem/hugetlb/hugeshmat/hugeshmat03.c | 2 +- .../mem/hugetlb/hugeshmat/hugeshmat04.c | 2 +- .../mem/hugetlb/hugeshmat/hugeshmat05.c | 2 +- .../mem/hugetlb/hugeshmctl/hugeshmctl01.c | 2 +- .../mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +- .../mem/hugetlb/hugeshmctl/hugeshmctl03.c | 2 +- .../mem/hugetlb/hugeshmdt/hugeshmdt01.c | 2 +- .../mem/hugetlb/hugeshmget/hugeshmget01.c | 2 +- .../mem/hugetlb/hugeshmget/hugeshmget02.c | 2 +- .../mem/hugetlb/hugeshmget/hugeshmget03.c | 2 +- .../mem/hugetlb/hugeshmget/hugeshmget05.c | 2 +- .../mem/hugetlb/hugeshmget/hugeshmget06.c | 2 +- testcases/kernel/mem/hugetlb/lib/Makefile | 10 --- testcases/kernel/mem/ksm/ksm02.c | 5 +- testcases/kernel/mem/ksm/ksm04.c | 7 +- testcases/kernel/mem/oom/oom04.c | 1 + testcases/kernel/mem/oom/oom05.c | 1 + 64 files changed, 179 insertions(+), 177 deletions(-) rename testcases/kernel/mem/hugetlb/lib/hugetlb.h => include/tst_hugetlb.h (91%) create mode 100644 libs/hugetlb/Makefile rename testcases/kernel/mem/hugetlb/lib/hugetlb.c => libs/hugetlb/libhugetlb.c (90%) delete mode 100644 testcases/kernel/lib/numa_cpuset.c delete mode 100644 testcases/kernel/mem/hugetlb/lib/Makefile
include/tst_hugetlb.h renamed from testcases/kernel/mem/hugetlb/lib/hugetlb.h +4 -4
@@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * * Copyright (c) Linux Test Project, 2004-2025
@@ -9,8 +9,8 @@* hugetlb.h - common definitions for the hugepage tests */ -#ifndef __HUGETLB_H -#define __HUGETLB_H +#ifndef TST_HUGETLB_H +#define TST_HUGETLB_H #include <stdlib.h> #include <sys/ipc.h>
@@ -61,4 +61,4 @@ int do_readback(void *p, size_t size, char *desc);void update_shm_size (size_t *shm_size); -#endif /* hugetlb.h */ +#endif /* TST_HUGETLB_H */
include/tst_numa.h +9 -0
@@ -119,4 +119,13 @@ enum tst_numa_types {*/ struct tst_nodemap *tst_get_nodemap (int type,size_t min_mem_kb); +struct tst_cg_group ; + +/** +* write_node_cpusets() - Writes cpusets for a given node. +* @cg: Cgroup structure. +* @nd: Node number. +*/ +void write_node_cpusets (const struct tst_cg_group *cg,long nd); +#endif /* TST_NUMA_H__ */
libs/hugetlb/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# This follows the naming convention seen in your ls -R output +LIB := libltphugetlb.a + +include $(top_srcdir)/include/mk/lib.mk
libs/hugetlb/libhugetlb.c renamed from testcases/kernel/mem/hugetlb/lib/hugetlb.c +5 -5
@@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) Linux Test Project, 2006-2025 * Copyright (c) International Business Machines Corp., 2001
@@ -10,7 +10,7 @@#include <sys/shm.h> #include <sys/time.h> #include <pwd.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" key_t shmkey;
@@ -91,15 +91,15 @@ int do_readback(void *p, size_t size, char *desc)for (i =0 ; i < (size /sizeof (*q)); i++) {if (q[i] != (RANDOM_CONSTANT ^ i)) { -tst_res (TFAIL ,"At \"%s\": Mismatch at offset 0x%lx: 0x%x " -"instead of 0x%lx" , desc, i, q[i],RANDOM_CONSTANT ^ i); +tst_res (TFAIL ,"At \"%s\": Mismatch at offset 0x%lx: 0x%x instead of 0x%lx" , + desc, i, q[i],RANDOM_CONSTANT ^ i);return -1 ; } }return 0 ; } -void update_shm_size (size_t * shm_size) +void update_shm_size (size_t *shm_size) {size_t shmmax;
libs/numa/tst_numa.c +70 -9
136 lines not on this page · raw message
testcases/kernel/include/numa_helper.h +1 -1
@@ -55,6 +55,6 @@ int get_allowed_nodes(int flag, int count, ...);void nh_dump_nodes (void );int is_numa (void (*cleanup_fn)(void ),int flag,int min_nodes); -void write_node_cpusets (const struct tst_cg_group *cg,long nd); +#endif /* NUMA_HELPER_H */
testcases/kernel/lib/numa_cpuset.c deleted +0 -64
64 lines not on this page · raw message
testcases/kernel/mem/hugetlb/Makefile +8 -20
@@ -1,25 +1,13 @@ # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) International Business Machines Corp., 2001 +# Copyright (c) International Business Machines Corp., 2001 -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. -include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/env_pre.mk -LIBDIR := lib -LIB := $(LIBDIR)/libhugetlb.a -FILTER_OUT_DIRS := $(LIBDIR) +# The actual test subdirectories are automatically found +# by generic_trunk_target.mk. +# We don't need to define LIB or MAKE_DEPS here because +# they are now handled in Makefile.inc. -$(LIBDIR): - mkdir -p "$@" - -$(LIB): $(LIBDIR) - $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all - -MAKE_DEPS := $(LIB) - -trunk-clean:: | lib-clean - -lib-clean:: $(LIBDIR) - $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean - -include $(top_srcdir)/include/mk/generic_trunk_target.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk
testcases/kernel/mem/hugetlb/Makefile.inc +14 -10
@@ -21,15 +21,19 @@ # # DO NOT USE THIS FILE FOR hugetlb / lib!!! -LIBIPCDIR := ../lib -LIBIPC := $(LIBIPCDIR)/libhugetlb.a -$(LIBIPCDIR): - mkdir -p "$@" -$(LIBIPC): $(LIBIPCDIR) - $(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all +# Point to the new global library location +LIBHUGETLB_DIR := $(top_srcdir)/libs/hugetlb +LIBHUGETLB := $(LIBHUGETLB_DIR)/libltphugetlb.a -CPPFLAGS += -I$(abs_srcdir)/$(LIBIPCDIR) -LDFLAGS += -L$(abs_builddir)/$(LIBIPCDIR) -LDLIBS += -lhugetlb -MAKE_DEPS += $(LIBIPC) +# We don't need to mkdir here anymore because the folder is part of the repo +# But we must ensure the library is built before the test +$(LIBHUGETLB): + $(MAKE) -C $(LIBHUGETLB_DIR) all + +# Linker flags: Tell the compiler where to find the .a file and what to call it +LDFLAGS += -L$(LIBHUGETLB_DIR) +LDLIBS += -lltphugetlb + +# Ensure the library is a dependency for the tests +MAKE_DEPS += $(LIBHUGETLB)
testcases/kernel/mem/hugetlb/hugefallocate/hugefallocate01.c +1 -1
@@ -18,7 +18,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "lapi/fallocate.h" #define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugefallocate/hugefallocate02.c +1 -1
@@ -16,7 +16,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "lapi/fallocate.h" #define MAX_PAGES_TO_USE 5
testcases/kernel/mem/hugetlb/hugefork/hugefork01.c +1 -1
@@ -19,7 +19,7 @@#include <unistd.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define C1 0x1234ABCD#define C2 ~0x1234ABCD
testcases/kernel/mem/hugetlb/hugefork/hugefork02.c +1 -1
@@ -11,7 +11,7 @@*/ #include "tst_safe_sysv_ipc.h" -#include "hugetlb.h" +#include "tst_hugetlb.h" static int shmid =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c +1 -1
@@ -26,7 +26,7 @@#include <sys/mount.h> #include <limits.h> #include <sys/param.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static long *addr;static int fildes;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c +1 -1
@@ -29,7 +29,7 @@#include <limits.h> #include <sys/param.h> #include "lapi/abisize.h" -#include "hugetlb.h" +#include "tst_hugetlb.h" #define LOW_ADDR 0x80000000#define LOW_ADDR2 0x90000000
testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c +1 -1
@@ -28,7 +28,7 @@#include <limits.h> #include <sys/param.h> #include "lapi/abisize.h" -#include "hugetlb.h" +#include "tst_hugetlb.h" static char TEMPFILE [MAXPATHLEN ];
testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c +1 -1
@@ -17,7 +17,7 @@#include <string.h> #include <unistd.h> #include <stdio.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "tst_safe_sysv_ipc.h" #include "tst_test.h"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c +1 -1
@@ -26,7 +26,7 @@#define _GNU_SOURCE#include <pthread.h> #include <stdio.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "lapi/mmap.h" static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap07.c +1 -1
@@ -18,7 +18,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "tst_safe_stdio.h" #define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap08.c +1 -1
@@ -26,7 +26,7 @@#include <sys/wait.h> #include <signal.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"#define WITH_OVERCOMMIT 0
testcases/kernel/mem/hugetlb/hugemmap/hugemmap09.c +1 -1
@@ -18,7 +18,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c +1 -1
@@ -20,7 +20,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap11.c +1 -1
@@ -17,7 +17,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define P0 "ffffffff"#define IOSZ 4096
testcases/kernel/mem/hugetlb/hugemmap/hugemmap12.c +1 -1
@@ -20,7 +20,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap13.c +1 -1
@@ -21,7 +21,7 @@#include <sys/types.h> #include <lapi/mmap.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define FOURGB (1ULL << 32)#define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap14.c +1 -1
@@ -21,7 +21,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define FOURGB (1ULL << 32)#define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c +1 -1
@@ -22,7 +22,7 @@#endif #define _GNU_SOURCE -#include "hugetlb.h" +#include "tst_hugetlb.h" #if defined(__powerpc__) || defined(__powerpc64__) || defined(__ia64__) || \ defined(__s390__) || defined(__s390x__) || defined(__sparc__) || \
testcases/kernel/mem/hugetlb/hugemmap/hugemmap16.c +1 -1
@@ -20,7 +20,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap17.c +1 -1
@@ -27,7 +27,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"#define MAP_LENGTH (4UL * hpage_size)
testcases/kernel/mem/hugetlb/hugemmap/hugemmap18.c +1 -1
@@ -26,7 +26,7 @@#include <stdlib.h> #include <sys/mman.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap19.c +1 -1
@@ -25,7 +25,7 @@#include <sys/param.h> #include <sys/types.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define RANDOM_CONSTANT 0x1234ABCD#define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c +1 -1
@@ -9,7 +9,7 @@* of MAP_PRIVATE and MAP_SHARED with and without MAP_LOCKED specified. */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"#define FLAGS_DESC (x) .flags = x, .flags_str = #x
testcases/kernel/mem/hugetlb/hugemmap/hugemmap21.c +1 -1
@@ -11,7 +11,7 @@* were not corrupted by the other threads. */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define THREADS 5#define NR_HUGEPAGES 6
testcases/kernel/mem/hugetlb/hugemmap/hugemmap22.c +1 -1
@@ -12,7 +12,7 @@* iterations. */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define NR_HUGEPAGES 2#define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap23.c +1 -1
@@ -12,7 +12,7 @@*/ #include <setjmp.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"#define RANDOM_CONSTANT 0x1234ABCD
testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c +1 -1
@@ -14,7 +14,7 @@*/ #define _GNU_SOURCE -#include "hugetlb.h" +#include "tst_hugetlb.h" #define RANDOM_CONSTANT 0x1234ABCD#define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap25.c +1 -1
@@ -14,7 +14,7 @@*/ #define _GNU_SOURCE -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap26.c +1 -1
@@ -14,7 +14,7 @@*/ #define _GNU_SOURCE -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap27.c +1 -1
@@ -12,7 +12,7 @@*/ #include <setjmp.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap28.c +1 -1
@@ -10,7 +10,7 @@* mapping. Otherwise, reserve count will be overflowed. */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap29.c +1 -1
@@ -12,7 +12,7 @@* shared mmap data. */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define C1 0x1234ABCD#define C2 0xFEDC9876
testcases/kernel/mem/hugetlb/hugemmap/hugemmap30.c +1 -1
@@ -14,7 +14,7 @@*/ #define _GNU_SOURCE -#include "hugetlb.h" +#include "tst_hugetlb.h" #define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap31.c +1 -1
@@ -10,7 +10,7 @@* seen to other mapping or not? */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define RANDOM_CONSTANT 0x1234ABCD#define MNTPOINT "hugetlbfs/"
testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c +1 -1
@@ -19,7 +19,7 @@#include <stdio.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define PATH_HUGEPAGE "/sys/kernel/mm/hugepages"#define GIGANTIC_MIN_ORDER 10
testcases/kernel/mem/hugetlb/hugemmap/hugemmap34.c +1 -1
@@ -20,7 +20,7 @@#define _GNU_SOURCE#include "lapi/mmap.h" -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "tst_safe_stdio.h" #include <errno.h> #include <inttypes.h>
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +1 -1
@@ -27,7 +27,7 @@*/ #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define CASE0 10/* values to write into the shared */ #define CASE1 20/* memory location. */
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c +1 -1
@@ -26,7 +26,7 @@#include <pwd.h> #include <limits.h> #include "lapi/abisize.h" -#include "hugetlb.h" +#include "tst_hugetlb.h" #ifdef TST_ABI64 #define NADDR 0x10000000eef/* a 64bit non alligned address value */
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c +1 -1
@@ -31,7 +31,7 @@*/ #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static size_t shm_size;static int shm_id_1 =-1 ;
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c +1 -1
@@ -19,7 +19,7 @@* test must be run at root */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #define SIZE (1024 * 1024 * 1024)#define BOUNDARY (1024 * 1024 * 1024)
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat05.c +1 -1
@@ -26,7 +26,7 @@* */ -#include "hugetlb.h" +#include "tst_hugetlb.h" static long page_size;static long hpage_size;
testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c +1 -1
@@ -10,7 +10,7 @@*/ #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #define N_ATTACH 4U#define NEWMODE 0066
testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c +1 -1
@@ -26,7 +26,7 @@#include <pwd.h> #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "lapi/syscalls.h" static size_t shm_size;
testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c +1 -1
@@ -36,7 +36,7 @@#include <sys/types.h> #include <sys/wait.h> #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static size_t shm_size;static int shm_id_1 =-1 ;
testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c +1 -1
@@ -30,7 +30,7 @@#include <setjmp.h> #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static size_t shm_size;static int shm_id_1 =-1 ;
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +1 -1
@@ -13,7 +13,7 @@*/ #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static size_t shm_size;static int shm_id_1 =-1 ;
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c +1 -1
@@ -12,7 +12,7 @@* 04/2004 - Updated by Robbie Williamson */ #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static size_t shm_size;static int shm_id_1 =-1 ;
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c +1 -1
@@ -12,7 +12,7 @@*/ #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" /* * The MAXIDS value is somewhat arbitrary and may need to be increased
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c +1 -1
@@ -14,7 +14,7 @@#include <sys/types.h> #include <sys/wait.h> #include <limits.h> -#include "hugetlb.h" +#include "tst_hugetlb.h" static size_t shm_size;static int shm_id_1 =-1 ;
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget06.c +1 -1
@@ -12,7 +12,7 @@* works correctly by validating the data written to segment. */ -#include "hugetlb.h" +#include "tst_hugetlb.h" #include "tst_safe_sysv_ipc.h" #define NR_HUGEPAGES 4
testcases/kernel/mem/hugetlb/lib/Makefile deleted +0 -10
@@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) International Business Machines Corp., 2001 - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INTERNAL_LIB := libhugetlb.a - -include $(top_srcdir)/include/mk/lib.mk
testcases/kernel/mem/ksm/ksm02.c +4 -1
@@ -54,7 +54,10 @@#include <stdio.h> #include <unistd.h> #include "tst_test.h" -#include "ksm_common.h" +#include "tst_safe_stdio.h" +#include "tst_numa.h" +#include "ksm_helper.h" +#include "numa_helper.h" #ifdef HAVE_NUMA_V2 #include <numaif.h>
testcases/kernel/mem/ksm/ksm04.c +4 -3
@@ -34,10 +34,11 @@#include <errno.h> #include <fcntl.h> #include <signal.h> -#include <stdio.h> -#include <unistd.h> #include "tst_test.h" -#include "ksm_common.h" +#include "tst_safe_stdio.h" +#include "tst_numa.h" +#include "ksm_helper.h" +#include "numa_helper.h" #ifdef HAVE_NUMA_V2 #include <numaif.h>
testcases/kernel/mem/oom/oom04.c +1 -0
@@ -19,6 +19,7 @@#include "tst_test.h" #include "numa_helper.h" +#include "tst_numa.h" #include "oom.h" #ifdef HAVE_NUMA_V2
testcases/kernel/mem/oom/oom05.c +1 -0
@@ -19,6 +19,7 @@#include "tst_test.h" #include "numa_helper.h" +#include "tst_numa.h" #include "oom.h" #ifdef HAVE_NUMA_V2
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 1 line · Pradeep Susarla
.../lib/hugetlb.h => include/tst_hugetlb.h | 8 +-
This would be better named "libhugetlb.h", anything under the ltp/libs/* should not have a prefix 'tst_' to distinguish the main LTP API.
Otherwise, people may be confused about tst_hugepage.h tst_hugetlb.h and can't find the '*.c' achieved file in ltp/lib/.
Quoted 1 line
include/tst_numa.h | 9 +++
Rename to libnuma.h.
There are some other libs/tst_*.c that should be renamed to prefix lib*, but yes, this is not related to your patch.
Quoted 7 lines
libs/hugetlb/Makefile | 8 ++ .../hugetlb.c => libs/hugetlb/libhugetlb.c | 10 +-- libs/numa/tst_numa.c | 79 ++++++++++++++++--- testcases/kernel/include/numa_helper.h | 2 +- testcases/kernel/lib/numa_cpuset.c | 64 --------------- testcases/kernel/mem/hugetlb/Makefile | 28 ++----- testcases/kernel/mem/hugetlb/Makefile.inc | 24 +++---
...
Quoted 3 lines
testcases/kernel/mem/hugetlb/lib/Makefile | 10 ---testcases/kernel/mem/ksm/ksm02.c | 5 +-
ksm02.c compile failed on CentOS 10 x86_64.
--
Regards,
Li Wang
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Pradeep,
Quoted 2 lines · Li Wang
There are some other
libs/tst_*.cthat should be renamed to prefix lib*, but yes, this is not related to your patch.
To simplify your work, I just sent a patch to rename all of that libs/, you could rebase your patch on this one once others ACK the change.
https://lists.linux.it/pipermail/ltp/2026-January/046071.html
Signature · 6 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp