mbox series

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

Message ID cover.1735932169.git.lorenzo.stoakes@oracle.com (mailing list archive)
Headers show
Series mm/debug: introduce and use VM_WARN_ON_VMG() | expand

Message

Lorenzo Stoakes Jan. 3, 2025, 7:35 p.m. UTC
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/6774c98f.050a0220.25abdd.0991.GAE@google.com/

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