linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
	David Hildenbrand <david@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 0/2] mm/debug: introduce and use VM_WARN_ON_VMG()
Date: Fri,  3 Jan 2025 19:35:34 +0000	[thread overview]
Message-ID: <cover.1735932169.git.lorenzo.stoakes@oracle.com> (raw)

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


             reply	other threads:[~2025-01-03 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03 19:35 Lorenzo Stoakes [this message]
2025-01-03 19:35 ` [PATCH 1/2] mm/debug: introduce VM_WARN_ON_VMG() to dump VMA merge state Lorenzo Stoakes
2025-01-03 19:35 ` [PATCH 2/2] mm/debug: prefer VM_WARN_ON_VMG() to report VMG debug warnings Lorenzo Stoakes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1735932169.git.lorenzo.stoakes@oracle.com \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox