]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/testing/vma: separate VMA userland tests into separate files
authorLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Thu, 22 Jan 2026 16:06:20 +0000 (16:06 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 12 Feb 2026 23:42:59 +0000 (15:42 -0800)
commit6aacab308a5dfd222b2d23662bbae60c11007cfb
treebcf66ccf224c1a0034f9651e5801f80ea2cbccde
parent53f1d936445131cb5da2212c2b60884a25cb0330
tools/testing/vma: separate VMA userland tests into separate files

So far the userland VMA tests have been established as a rough expression
of what's been possible.

Adapt it into a more usable form by separating out tests and shared
helper functions.

Since we test functions that are declared statically in mm/vma.c, we make
use of the trick of #include'ing kernel C files directly.

In order for the tests to continue to function, we must therefore also
this way into the tests/ directory.

We try to keep as much shared logic actually modularised into a separate
compilation unit in shared.c, however the merge_existing() and
attach_vma() helpers rely on statically declared mm/vma.c functions so
these must be declared in main.c.

Link: https://lkml.kernel.org/r/a0455ccfe4fdcd1c962c64f76304f612e5662a4e.1769097829.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Yury Norov <ynorov@nvidia.com>
Cc: Chris Mason <clm@fb.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/vma/Makefile
tools/testing/vma/main.c [new file with mode: 0644]
tools/testing/vma/shared.c [new file with mode: 0644]
tools/testing/vma/shared.h [new file with mode: 0644]
tools/testing/vma/tests/merge.c [moved from tools/testing/vma/vma.c with 82% similarity]
tools/testing/vma/tests/mmap.c [new file with mode: 0644]
tools/testing/vma/tests/vma.c [new file with mode: 0644]
tools/testing/vma/vma_internal.h