[LTP] [PATCH 00/13] Get rid of testcases/kernel/mem/lib library

Cyril Hrubis
2024-12-18T18:45:55Z

This patchset slowly untangles the mess called kernel/mem/lib/ library.

The library is split into several places, functions that are used by
more than one group of tests are either reimplemented in the top level
library or in the case of numa moved into numa_helper library in
testcases/kerne/include/ and testcases/kernel/lib/.

The rest of the code is either moved into respective test directories or
in the case of unused code removed.

This is not a coplete cleanup of the mem/ testcases as it mostly just
moves code, but it's a nice first step that removes most of the unneeded
dependencies and prepares for a possible refactoring later on.

The CI run:

https://github.com/metan-ucw/ltp

Cyril Hrubis (13):
lib: tst_sys_conf: Add two functions
lib: Replace path_exist() with tst_path_exists()
lib: Add tst_mapping_in_range()
testcases/kernel/mem: Move get_a_numa_node()
testcases/kernel/mem: Move update_shm_size()
testcases/kernel/mem: Move check_hugepage() + PATH_THP
testcases/kernel/mem: Move NUMA bits to numa_helper.h
testcases/kernel/mem: Move oom() fucntions to oom tests
testcases/kernel/mem: Move KSM bits to ksm tests
mem/swapping: Remove mem/lib refrence
mem/vma: Remove mem/lib dependency
mem/hugetlb: Remove mem/lib depenency
testcases/kernel/mem: Remove library

include/tst_fs.h | 10 +
include/tst_memutils.h | 11 +
include/tst_sys_conf.h | 31 +
lib/tst_memutils.c | 31 +
lib/tst_path_exists.c | 23 +
lib/tst_sys_conf.c | 29 +
testcases/kernel/include/numa_helper.h | 21 +
testcases/kernel/lib/numa_cpuset.c | 64 ++
testcases/kernel/mem/cpuset/Makefile | 2 +-
testcases/kernel/mem/cpuset/cpuset01.c | 4 +-
testcases/kernel/mem/hugetlb/Makefile.inc | 3 -
.../kernel/mem/hugetlb/hugemmap/hugemmap02.c | 4 +-
.../kernel/mem/hugetlb/hugemmap/hugemmap05.c | 1 -
.../kernel/mem/hugetlb/hugemmap/hugemmap13.c | 4 +-
.../kernel/mem/hugetlb/hugemmap/hugemmap14.c | 6 +-
.../mem/hugetlb/hugeshmat/hugeshmat04.c | 4 +-
testcases/kernel/mem/hugetlb/lib/Makefile | 1 -
testcases/kernel/mem/hugetlb/lib/hugetlb.c | 11 +
testcases/kernel/mem/hugetlb/lib/hugetlb.h | 6 +-
testcases/kernel/mem/include/libmem.mk | 43 --
testcases/kernel/mem/include/mem.h | 81 --
testcases/kernel/mem/ksm/Makefile | 2 +-
testcases/kernel/mem/ksm/ksm01.c | 2 +-
testcases/kernel/mem/ksm/ksm02.c | 4 +-
testcases/kernel/mem/ksm/ksm03.c | 2 +-
testcases/kernel/mem/ksm/ksm04.c | 4 +-
testcases/kernel/mem/ksm/ksm05.c | 2 +-
testcases/kernel/mem/ksm/ksm06.c | 4 +-
testcases/kernel/mem/ksm/ksm07.c | 3 +-
testcases/kernel/mem/ksm/ksm_common.h | 36 +
testcases/kernel/mem/ksm/ksm_test.h | 299 ++++++++
testcases/kernel/mem/lib/Makefile | 27 -
testcases/kernel/mem/lib/mem.c | 711 ------------------
testcases/kernel/mem/oom/Makefile | 7 +-
testcases/kernel/mem/oom/oom.h | 231 ++++++
testcases/kernel/mem/oom/oom01.c | 13 +-
testcases/kernel/mem/oom/oom02.c | 5 +-
testcases/kernel/mem/oom/oom03.c | 11 +-
testcases/kernel/mem/oom/oom04.c | 7 +-
testcases/kernel/mem/oom/oom05.c | 11 +-
testcases/kernel/mem/swapping/Makefile | 1 -
testcases/kernel/mem/swapping/swapping01.c | 2 +-
testcases/kernel/mem/thp/Makefile | 2 +-
testcases/kernel/mem/thp/thp.h | 17 +
testcases/kernel/mem/thp/thp01.c | 1 -
testcases/kernel/mem/thp/thp02.c | 3 +-
testcases/kernel/mem/thp/thp03.c | 5 +-
testcases/kernel/mem/tunable/Makefile | 1 -
testcases/kernel/mem/tunable/max_map_count.c | 17 +-
.../kernel/mem/tunable/min_free_kbytes.c | 27 +-
.../kernel/mem/tunable/overcommit_memory.c | 23 +-
testcases/kernel/mem/vma/Makefile | 2 +-
52 files changed, 922 insertions(+), 950 deletions(-)
create mode 100644 lib/tst_path_exists.c
create mode 100644 testcases/kernel/lib/numa_cpuset.c
delete mode 100644 testcases/kernel/mem/include/libmem.mk
delete mode 100644 testcases/kernel/mem/include/mem.h
create mode 100644 testcases/kernel/mem/ksm/ksm_test.h
delete mode 100644 testcases/kernel/mem/lib/Makefile
delete mode 100644 testcases/kernel/mem/lib/mem.c
create mode 100644 testcases/kernel/mem/oom/oom.h
create mode 100644 testcases/kernel/mem/thp/thp.h

--
2.45.2