From: Jason Gunthorpe <jgg@ziepe.ca>
To: John Hubbard <jhubbard@nvidia.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Ralph Campbell" <rcampbell@nvidia.com>,
"Shuah Khan" <shuah@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-doc@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency
Date: Mon, 28 Sep 2020 10:02:45 -0300 [thread overview]
Message-ID: <20200928130245.GQ9916@ziepe.ca> (raw)
In-Reply-To: <20200928062159.923212-9-jhubbard@nvidia.com>
On Sun, Sep 27, 2020 at 11:21:59PM -0700, John Hubbard wrote:
> @@ -76,8 +79,6 @@ TEST_FILES := test_vmalloc.sh
> KSFT_KHDR_INSTALL := 1
> include ../lib.mk
>
> -$(OUTPUT)/hmm-tests: LDLIBS += -lhugetlbfs
> -
> ifeq ($(ARCH),x86_64)
> BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
> BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
> @@ -130,3 +131,22 @@ endif
> $(OUTPUT)/mlock-random-test: LDLIBS += -lcap
>
> $(OUTPUT)/gup_test: ../../../../mm/gup_test.h
> +
> +$(OUTPUT)/hmm-tests: local_config.h
> +
> +# HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty.
> +$(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)
> +
> +local_config.mk local_config.h: check_config.sh
> + ./check_config.sh
> +
> +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
> diff --git a/tools/testing/selftests/vm/check_config.sh b/tools/testing/selftests/vm/check_config.sh
> new file mode 100755
> index 000000000000..651a4b192479
> +++ b/tools/testing/selftests/vm/check_config.sh
> @@ -0,0 +1,30 @@
> +#!/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
> +
> +gcc -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1
This gcc has to come from some makefile variable
This is kind of janky :\
Could we just not use libhugetlbfs? Doesn't it all just boil down to
creating a file in /dev/huge? Eg look at tools/testing/selftests/vm/hugepage-mmap.c
Jason
next prev parent reply other threads:[~2020-09-28 13:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 6:21 [PATCH 0/8] selftests/vm: gup_test, hmm-tests, assorted improvements John Hubbard
2020-09-28 6:21 ` [PATCH 1/8] mm/gup_benchmark: rename to mm/gup_test John Hubbard
2020-09-28 6:21 ` [PATCH 2/8] selftests/vm: use a common gup_test.h John Hubbard
2020-09-28 12:57 ` Jason Gunthorpe
2020-09-28 20:10 ` John Hubbard
2020-09-29 16:35 ` Jason Gunthorpe
2020-09-29 17:44 ` John Hubbard
2020-09-29 17:55 ` Jason Gunthorpe
2020-09-29 18:59 ` John Hubbard
2020-09-29 19:08 ` Jason Gunthorpe
2020-09-29 19:48 ` John Hubbard
2020-09-29 19:53 ` Jason Gunthorpe
2020-09-29 20:00 ` Shuah Khan
2020-09-29 20:11 ` John Hubbard
2020-09-29 20:20 ` Shuah Khan
2020-09-29 20:36 ` John Hubbard
2020-09-28 6:21 ` [PATCH 3/8] selftests/vm: rename run_vmtests --> run_vmtests.sh John Hubbard
2020-09-28 6:21 ` [PATCH 4/8] selftests/vm: minor cleanup: Makefile and gup_test.c John Hubbard
2020-09-28 6:21 ` [PATCH 5/8] selftests/vm: only some gup_test items are really benchmarks John Hubbard
2020-09-28 6:21 ` [PATCH 6/8] selftests/vm: gup_test: introduce the dump_pages() sub-test John Hubbard
2020-09-28 19:25 ` Ira Weiny
2020-09-28 6:21 ` [PATCH 7/8] selftests/vm: run_vmtest.sh: update and clean up gup_test invocation John Hubbard
2020-09-28 19:26 ` Ira Weiny
2020-09-28 19:58 ` John Hubbard
2020-09-28 6:21 ` [PATCH 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency John Hubbard
2020-09-28 13:02 ` Jason Gunthorpe [this message]
2020-09-28 20:18 ` John Hubbard
2020-09-28 20:45 ` John Hubbard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200928130245.GQ9916@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=jglisse@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=rcampbell@nvidia.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.