Skip to contentSkip to conversation

Kselftests: Removing support of libhugetlbfs from kselftests

PATCH Applied Tarun Sahu 1 participant 1 message Aug 1, 2022

Subsystems (2)
lore
Share & tools
lore

Tarun Sahu

author
#0 lore raw

PATCH 1/1 Kselftests: Removing support of libhugetlbfs from kselftests

libhugetlbfs, the user side utitlity to work with hugepages, does not have any active support. There are only 2 selftests which are part of in vm/hmm_test.c that depends on libhugetlbfs.

This patch modifes the tests so that they will not require libhugetlb library.

---
Instead of using general function from libhugetlbfs, this patch only uses the required part from it which are actually being used in these tests.

Results:
I tested it on Power9 with hash page translation(Hugepage size=16M) and Power10 with radix page translation(Hugepage size=2M).

tools/testing/selftests/vm/Makefile | 17 ----

 tools/testing/selftests/vm/check_config.sh |  31 ------
 tools/testing/selftests/vm/hmm-tests.c     | 108 ++++++++++++++-------
 3 files changed, 73 insertions(+), 83 deletions(-)
 delete mode 100644 tools/testing/selftests/vm/check_config.sh
tools/testing/selftests/vm/Makefile +0 -17
index 44f25acfbeca..006b7747b7fd 100644
@@ -152,23 +152,6 @@ endif
 
 $(OUTPUT)/mlock-random-test $(OUTPUT)/memfd_secret: LDLIBS += -lcap
 
-# HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty.
-$(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)
-
 $(OUTPUT)/ksm_tests: LDLIBS += -lnuma
 
 $(OUTPUT)/migration: LDLIBS += -lnuma
-
-local_config.mk local_config.h: check_config.sh
-	/bin/sh ./check_config.sh $(CC)
-
-EXTRA_CLEAN += local_config.mk local_config.h
-
-ifeq ($(HMM_EXTRA_LIBS),)
-all: warn_missing_hugelibs
-
-warn_missing_hugelibs:
-	@echo ; \
-	echo "Warning: missing libhugetlbfs support. Some HMM tests will be skipped." ; \
-	echo
-endif
tools/testing/selftests/vm/check_config.sh deleted +0 -31
deleted file mode 100644
index 079c8a40b85d..000000000000
@@ -1,31 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-#
-# Probe for libraries and create header files to record the results. Both C
-# header files and Makefile include fragments are created.
-
-OUTPUT_H_FILE=local_config.h
-OUTPUT_MKFILE=local_config.mk
-
-# libhugetlbfs
-tmpname=$(mktemp)
-tmpfile_c=${tmpname}.c
-tmpfile_o=${tmpname}.o
-
-echo "#include <sys/types.h>"        > $tmpfile_c
-echo "#include <hugetlbfs.h>"       >> $tmpfile_c
-echo "int func(void) { return 0; }" >> $tmpfile_c
-
-CC=${1:?"Usage: $0 <compiler> # example compiler: gcc"}
-$CC -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1
-
-if [ -f $tmpfile_o ]; then
-    echo "#define LOCAL_CONFIG_HAVE_LIBHUGETLBFS 1" > $OUTPUT_H_FILE
-    echo "HMM_EXTRA_LIBS = -lhugetlbfs"             > $OUTPUT_MKFILE
-else
-    echo "// No libhugetlbfs support found"      > $OUTPUT_H_FILE
-    echo "# No libhugetlbfs support found, so:"  > $OUTPUT_MKFILE
-    echo "HMM_EXTRA_LIBS = "                    >> $OUTPUT_MKFILE
-fi
-
-rm ${tmpname}.*
tools/testing/selftests/vm/hmm-tests.c +73 -35

178 lines not on this page · raw message

Signature · 1 line
2.35.1