linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC Patch 0/5] Make anon_vma operations testable
@ 2025-04-29  9:06 Wei Yang
  2025-04-29  9:06 ` [RFC Patch 1/5] mm: move anon_vma manipulation functions to own file Wei Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 29+ messages in thread
From: Wei Yang @ 2025-04-29  9:06 UTC (permalink / raw)
  To: akpm
  Cc: david, lorenzo.stoakes, riel, vbabka, harry.yoo, jannh, baohua,
	linux-mm, Wei Yang

There are several anon_vma manipulation functions implemented in mm/rmap.c,
those concerning anon_vma preparing, cloning and forking, which logically
could be stand-alone.

This patch series isolates anon_vma manipulation functionality into its own
file, mm/anon_vma.c, and provides an API to the rest of the kernel in
include/linux/anon_vma.h.

It also introduce mm/anon_vma_internal.h, which specifies which headers need
to be imported by anon_vma.c, leading to the very useful property that
anon_vma.c depends only on include/linux/anon_vma.h and
mm/anon_vma_internal.h.

This means we can then re-implement anon_vma_internal.h in userland, adding
shims for kernel mechanisms as required, allowing us to unit test internal
anon_vma functionality.

This patch series takes advantage of existing shim logic and full userland
interval tree support contained in tools/testing/rbtree/ and
tools/include/linux/.

Kernel functionality is stubbed and shimmed as needed in
tools/testing/anon_vma/ which contains a fully functional userland
anon_vma_internal.h file and which imports mm/anon_vma.c to be directly tested
from userland.

Patch 1 split anon_vma related logic to mm/anon_vma.c
Patch 2 add a simple skeleton testing on simple fault and fork
Patch 3/4 add tests for mergeable and reusable anon_vma
Patch 5 assert the anon_vma double-reuse is fixed

Wei Yang (5):
  mm: move anon_vma manipulation functions to own file
  anon_vma: add skeleton code for userland testing of anon_vma logic
  anon_vma: add test for mergeable anon_vma
  anon_vma: add test for reusable anon_vma
  anon_vma: add test to assert no double-reuse

 MAINTAINERS                                |   3 +
 include/linux/anon_vma.h                   | 163 +++++
 include/linux/rmap.h                       | 147 +---
 mm/Makefile                                |   2 +-
 mm/anon_vma.c                              | 396 +++++++++++
 mm/anon_vma_internal.h                     |  14 +
 mm/rmap.c                                  | 391 -----------
 tools/include/linux/rwsem.h                |  10 +
 tools/include/linux/slab.h                 |   4 +
 tools/testing/anon_vma/.gitignore          |   3 +
 tools/testing/anon_vma/Makefile            |  25 +
 tools/testing/anon_vma/anon_vma.c          | 773 +++++++++++++++++++++
 tools/testing/anon_vma/anon_vma_internal.h |  88 +++
 tools/testing/anon_vma/interval_tree.c     |  53 ++
 tools/testing/anon_vma/linux/atomic.h      |  18 +
 tools/testing/anon_vma/linux/fs.h          |   6 +
 tools/testing/anon_vma/linux/mm.h          |  44 ++
 tools/testing/anon_vma/linux/mm_types.h    |  57 ++
 tools/testing/anon_vma/linux/mmzone.h      |   6 +
 tools/testing/anon_vma/linux/rmap.h        |   8 +
 tools/testing/shared/linux/anon_vma.h      |   7 +
 21 files changed, 1680 insertions(+), 538 deletions(-)
 create mode 100644 include/linux/anon_vma.h
 create mode 100644 mm/anon_vma.c
 create mode 100644 mm/anon_vma_internal.h
 create mode 100644 tools/testing/anon_vma/.gitignore
 create mode 100644 tools/testing/anon_vma/Makefile
 create mode 100644 tools/testing/anon_vma/anon_vma.c
 create mode 100644 tools/testing/anon_vma/anon_vma_internal.h
 create mode 100644 tools/testing/anon_vma/interval_tree.c
 create mode 100644 tools/testing/anon_vma/linux/atomic.h
 create mode 100644 tools/testing/anon_vma/linux/fs.h
 create mode 100644 tools/testing/anon_vma/linux/mm.h
 create mode 100644 tools/testing/anon_vma/linux/mm_types.h
 create mode 100644 tools/testing/anon_vma/linux/mmzone.h
 create mode 100644 tools/testing/anon_vma/linux/rmap.h
 create mode 100644 tools/testing/shared/linux/anon_vma.h

-- 
2.34.1



^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2025-06-03 21:31 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29  9:06 [RFC Patch 0/5] Make anon_vma operations testable Wei Yang
2025-04-29  9:06 ` [RFC Patch 1/5] mm: move anon_vma manipulation functions to own file Wei Yang
2025-04-29  9:06 ` [RFC Patch 2/5] anon_vma: add skeleton code for userland testing of anon_vma logic Wei Yang
2025-05-01  1:31   ` Wei Yang
2025-05-01  9:41     ` Lorenzo Stoakes
2025-05-01 14:45       ` Wei Yang
2025-04-29  9:06 ` [RFC Patch 3/5] anon_vma: add test for mergeable anon_vma Wei Yang
2025-04-29  9:06 ` [RFC Patch 4/5] anon_vma: add test for reusable anon_vma Wei Yang
2025-04-29  9:06 ` [RFC Patch 5/5] anon_vma: add test to assert no double-reuse Wei Yang
2025-04-29  9:31 ` [RFC Patch 0/5] Make anon_vma operations testable Lorenzo Stoakes
2025-04-29  9:38   ` David Hildenbrand
2025-04-29  9:41     ` Lorenzo Stoakes
2025-04-29 23:56       ` Wei Yang
2025-04-30  7:47         ` David Hildenbrand
2025-04-30 15:44           ` Wei Yang
2025-04-30 21:36             ` David Hildenbrand
2025-05-14  1:23           ` Wei Yang
2025-05-27  6:34             ` Wei Yang
2025-05-27 11:31               ` David Hildenbrand
2025-05-28  1:17                 ` Wei Yang
2025-05-30  2:11                 ` Wei Yang
2025-05-30  8:00                   ` David Hildenbrand
2025-05-30 14:05                     ` Wei Yang
2025-05-30 14:39                       ` David Hildenbrand
2025-05-30 23:23                         ` Wei Yang
2025-06-03 21:31                           ` David Hildenbrand
2025-04-29 23:15   ` Wei Yang
2025-04-30 14:38     ` Lorenzo Stoakes
2025-04-30 15:41       ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).