[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZH4GUODwj9L9paey@x1n>
Date: Mon, 5 Jun 2023 11:59:12 -0400
From: Peter Xu <peterx@...hat.com>
To: John Hubbard <jhubbard@...dia.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 10/11] selftests/mm: move uffd* routines from
vm_util.c to uffd-common.c
On Fri, Jun 02, 2023 at 07:15:57PM -0700, John Hubbard wrote:
> Move the uffd*() routines to their natural home. Note that
> ksm_functional_tests.c also depend, intentionally (due to a recent
> commit [1]), upon uffd-common.[ch].
>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Peter Xu <peterx@...hat.com>
> Signed-off-by: John Hubbard <jhubbard@...dia.com>
> ---
> tools/testing/selftests/mm/Makefile | 7 +-
> tools/testing/selftests/mm/hugepage-mremap.c | 2 +-
> .../selftests/mm/ksm_functional_tests.c | 2 +-
> tools/testing/selftests/mm/uffd-common.c | 105 ++++++++++++++++++
> tools/testing/selftests/mm/uffd-common.h | 12 +-
> tools/testing/selftests/mm/vm_util.c | 104 -----------------
> tools/testing/selftests/mm/vm_util.h | 10 --
> 7 files changed, 122 insertions(+), 120 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
> index 23af4633f0f4..a15572758954 100644
> --- a/tools/testing/selftests/mm/Makefile
> +++ b/tools/testing/selftests/mm/Makefile
> @@ -109,8 +109,11 @@ include ../lib.mk
>
> $(TEST_GEN_PROGS): vm_util.c
>
> -$(OUTPUT)/uffd-stress: uffd-common.c
> -$(OUTPUT)/uffd-unit-tests: uffd-common.c
> +$(OUTPUT)/uffd-stress: uffd-common.c
> +$(OUTPUT)/uffd-unit-tests: uffd-common.c
> +$(OUTPUT)/hugepage-mremap: uffd-common.c
> +$(OUTPUT)/write_to_hugetlbfs: uffd-common.c
> +$(OUTPUT)/ksm_functional_tests: uffd-common.c
Sorry, John, I still cannot follow..
As I said before uffd-common.[ch] was for uffd stress/unit tests. I
confess my fault to not have named it uffd-test-common.[ch] already.
I think it's fine to keep uffd_*() helpers in vm_util.[ch] for now, until
it grows. Just like if one day we'll have a pagemap.c test we don't
necessary need to move pagemap_*() helpers from vm_utils.[ch] into
pagemap.[ch]. It just keeps common test helpers.
Can we avoid linking those into other tests in whatever way? Maybe
renaming it to uffd-test-common.[ch] may be cleaner?
--
Peter Xu
Powered by blists - more mailing lists