Skip to content

mm/debug: introduce and use VM_WARN_ON_VMG()

Lorenzo Stoakes linux-mm lkml 1 version Applied

Status from this message: [merged mm-stable] mm-debug-prefer-vm_warn_on_vmg-to-report-vmg-debug-warnings.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/debug: introduce VM_WARN_ON_VMG() to dump VMA merge stateinclude/linux/mmdebug.h mm/debug.c+84 -10 repliesApplied
2/2mm/debug: prefer VM_WARN_ON_VMG() to report VMG debug warningsmm/vma.c+17 -160 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] mm/debug: introduce and use VM_WARN_ON_VMG()

We use a number of asserts, enabled only when CONFIG_DEBUG_VM is set, during VMA merge operations to ensure state is as expected.

However, when syzkaller or the like encounters these asserts, often the information provided by the report is insufficient to narrow down what the problem is.

We noticed this recently in [0], where a non-repro issue resisted debugging due to simply not having sufficient information to go on.

This series improves the situation by providing VM_WARN_ON_VMG() which acts like VM_WARN_ON() (i.e. only actually being invoked if CONFIG_DEBUG_VM is set), while dumping significant information about the VMA merge state, the mm_struct describing the virtual address space, all associated VMAs and, if CONFIG_DEBUG_VM_MAPLE_TREE is set, the associated maple tree.

[0]:https://lore.kernel.org/all/[email protected]/

Lorenzo Stoakes (2):
mm/debug: introduce VM_WARN_ON_VMG() to dump VMA merge state mm/debug: prefer VM_WARN_ON_VMG() to report VMG debug warnings

 include/linux/mmdebug.h | 14 +++++++-
 mm/debug.c              | 71 +++++++++++++++++++++++++++++++++++++++++
 mm/vma.c                | 33 +++++++++----------
 3 files changed, 101 insertions(+), 17 deletions(-)

--
2.47.1