linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] vma count: fixes, test and improvements
@ 2025-09-15 16:36 Kalesh Singh
  2025-09-15 16:36 ` [PATCH v2 1/7] mm: fix off-by-one error in VMA count limit checks Kalesh Singh
                   ` (7 more replies)
  0 siblings, 8 replies; 65+ messages in thread
From: Kalesh Singh @ 2025-09-15 16:36 UTC (permalink / raw)
  To: akpm, minchan, lorenzo.stoakes, david, Liam.Howlett, rppt,
	pfalcato
  Cc: kernel-team, android-mm, Kalesh Singh, Alexander Viro,
	Christian Brauner, Jan Kara, Kees Cook, Vlastimil Babka,
	Suren Baghdasaryan, Michal Hocko, Steven Rostedt,
	Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, Dietmar Eggemann, Ben Segall,
	Mel Gorman, Valentin Schneider, Jann Horn, Shuah Khan,
	linux-kernel, linux-fsdevel, linux-mm, linux-trace-kernel,
	linux-kselftest

Hi all,

This is v2 to the VMA count patch I previously posted at:

https://lore.kernel.org/r/20250903232437.1454293-1-kaleshsingh@google.com/


I've split it into multiple patches to address the feedback.

The main changes in v2 are:

- Use a capacity-based check for VMA count limit, per Lorenzo.
- Rename map_count to vma_count, per David.
- Add assertions for exceeding the limit, per Pedro.
- Add tests for max_vma_count, per Liam.
- Emit a trace event for failure due to insufficient capacity for
  observability

Tested on x86_64 and arm64:

- Build test:
    - allyesconfig for rename

- Selftests:
      cd tools/testing/selftests/mm && \
          make && \
          ./run_vmtests.sh -t max_vma_count

       (With trace_max_vma_count_exceeded enabled)

- vma tests:
      cd tools/testing/vma && \
          make && \
	  ./vma

Thanks,
Kalesh

Kalesh Singh (7):
  mm: fix off-by-one error in VMA count limit checks
  mm/selftests: add max_vma_count tests
  mm: introduce vma_count_remaining()
  mm: rename mm_struct::map_count to vma_count
  mm: harden vma_count against direct modification
  mm: add assertion for VMA count limit
  mm/tracing: introduce max_vma_count_exceeded trace event

 fs/binfmt_elf.c                               |   2 +-
 fs/coredump.c                                 |   2 +-
 include/linux/mm.h                            |  35 +-
 include/linux/mm_types.h                      |   5 +-
 include/trace/events/vma.h                    |  32 +
 kernel/fork.c                                 |   2 +-
 mm/debug.c                                    |   2 +-
 mm/internal.h                                 |   1 +
 mm/mmap.c                                     |  28 +-
 mm/mremap.c                                   |  13 +-
 mm/nommu.c                                    |   8 +-
 mm/util.c                                     |   1 -
 mm/vma.c                                      |  88 ++-
 tools/testing/selftests/mm/Makefile           |   1 +
 .../selftests/mm/max_vma_count_tests.c        | 709 ++++++++++++++++++
 tools/testing/selftests/mm/run_vmtests.sh     |   5 +
 tools/testing/vma/vma.c                       |  32 +-
 tools/testing/vma/vma_internal.h              |  44 +-
 18 files changed, 949 insertions(+), 61 deletions(-)
 create mode 100644 include/trace/events/vma.h
 create mode 100644 tools/testing/selftests/mm/max_vma_count_tests.c


base-commit: f83ec76bf285bea5727f478a68b894f5543ca76e
-- 
2.51.0.384.g4c02a37b29-goog


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

end of thread, other threads:[~2025-09-18 20:59 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-15 16:36 [PATCH v2 0/7] vma count: fixes, test and improvements Kalesh Singh
2025-09-15 16:36 ` [PATCH v2 1/7] mm: fix off-by-one error in VMA count limit checks Kalesh Singh
2025-09-15 22:36   ` Andrew Morton
2025-09-16 14:20     ` Jonathan Corbet
2025-09-17  1:16       ` Andrew Morton
2025-09-16  9:45   ` Pedro Falcato
2025-09-17  7:44   ` SeongJae Park
2025-09-17 10:52   ` David Hildenbrand
2025-09-18 11:31   ` Pedro Falcato
2025-09-18 13:53   ` Lorenzo Stoakes
2025-09-15 16:36 ` [PATCH v2 2/7] mm/selftests: add max_vma_count tests Kalesh Singh
2025-09-17 10:58   ` David Hildenbrand
2025-09-17 16:49     ` Kalesh Singh
2025-09-18 14:42   ` Lorenzo Stoakes
2025-09-18 16:21     ` Kalesh Singh
2025-09-15 16:36 ` [PATCH v2 3/7] mm: introduce vma_count_remaining() Kalesh Singh
2025-09-17 13:38   ` David Hildenbrand
2025-09-17 17:10     ` Kalesh Singh
2025-09-18 13:20   ` Lorenzo Stoakes
2025-09-18 13:26     ` Lorenzo Stoakes
2025-09-18 14:31   ` Lorenzo Stoakes
2025-09-18 15:52     ` Kalesh Singh
2025-09-15 16:36 ` [PATCH v2 4/7] mm: rename mm_struct::map_count to vma_count Kalesh Singh
2025-09-17 13:41   ` David Hildenbrand
2025-09-18 11:46   ` Pedro Falcato
2025-09-18 14:48   ` Lorenzo Stoakes
2025-09-15 16:36 ` [PATCH v2 5/7] mm: harden vma_count against direct modification Kalesh Singh
2025-09-18 14:52   ` Lorenzo Stoakes
2025-09-18 15:43     ` Kalesh Singh
2025-09-15 16:36 ` [PATCH v2 6/7] mm: add assertion for VMA count limit Kalesh Singh
2025-09-17 13:44   ` David Hildenbrand
2025-09-17 17:22     ` Kalesh Singh
2025-09-17 18:34       ` David Hildenbrand
2025-09-17 20:31         ` Kalesh Singh
2025-09-18 11:48     ` Pedro Falcato
2025-09-18 13:30   ` Lorenzo Stoakes
2025-09-15 16:36 ` [PATCH v2 7/7] mm/tracing: introduce max_vma_count_exceeded trace event Kalesh Singh
2025-09-15 23:41   ` Steven Rostedt
2025-09-16  1:19     ` Kalesh Singh
2025-09-16 15:52       ` Steven Rostedt
2025-09-16 17:36         ` Kalesh Singh
2025-09-16 17:48           ` Steven Rostedt
2025-09-16 17:57             ` Kalesh Singh
2025-09-16 18:02               ` Steven Rostedt
2025-09-16 18:23                 ` Kalesh Singh
2025-09-16 18:51                   ` Steven Rostedt
2025-09-16 20:08                     ` Kalesh Singh
2025-09-18 11:38         ` Pedro Falcato
2025-09-18 14:48           ` Steven Rostedt
2025-09-18 13:42   ` Lorenzo Stoakes
2025-09-18 13:51     ` Lorenzo Stoakes
2025-09-18 15:55       ` Kalesh Singh
2025-09-15 22:34 ` [PATCH v2 0/7] vma count: fixes, test and improvements Andrew Morton
2025-09-15 23:10   ` Kalesh Singh
2025-09-16  0:05     ` Andrew Morton
2025-09-16  1:23       ` Kalesh Singh
2025-09-16 10:12   ` Lorenzo Stoakes
2025-09-16 17:47     ` Kalesh Singh
2025-09-17  2:16     ` Andrew Morton
2025-09-17  5:36       ` Lorenzo Stoakes
2025-09-17 23:32         ` Andrew Morton
2025-09-18 10:29           ` Lorenzo Stoakes
2025-09-18 12:07             ` David Hildenbrand
2025-09-18 12:49               ` Lorenzo Stoakes
2025-09-18 20:59                 ` Andrew Morton

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).