From: Sasha Levin <sasha.levin@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, kirill@shutemov.name, linux-mm@kvack.org
Subject: [RFC 10/11] mm: debug: kill VM_BUG_ON_MM
Date: Tue, 14 Apr 2015 16:56:32 -0400 [thread overview]
Message-ID: <1429044993-1677-11-git-send-email-sasha.levin@oracle.com> (raw)
In-Reply-To: <1429044993-1677-1-git-send-email-sasha.levin@oracle.com>
Just use VM_BUG() instead.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
include/linux/mmdebug.h | 8 --------
kernel/fork.c | 2 +-
mm/gup.c | 2 +-
mm/huge_memory.c | 2 +-
mm/mmap.c | 2 +-
mm/pagewalk.c | 2 +-
6 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 5106ab5..b810800 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -20,13 +20,6 @@ char *format_mm(const struct mm_struct *mm, char *buf, char *end);
} \
} while (0)
#define VM_BUG_ON(cond) VM_BUG(cond, "%s\n", __stringify(cond))
-#define VM_BUG_ON_MM(cond, mm) \
- do { \
- if (unlikely(cond)) { \
- pr_emerg("%pZm", mm); \
- BUG(); \
- } \
- } while (0)
#define VM_WARN_ON(cond) WARN_ON(cond)
#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format)
@@ -41,7 +34,6 @@ static char *format_mm(const struct mm_struct *mm, char *buf, char *end)
}
#define VM_BUG(cond, fmt...) BUILD_BUG_ON_INVALID(cond)
#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
-#define VM_BUG_ON_MM(cond, mm) VM_BUG_ON(cond)
#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond)
diff --git a/kernel/fork.c b/kernel/fork.c
index 18c44fb..36a7c36 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -645,7 +645,7 @@ static void check_mm(struct mm_struct *mm)
mm_nr_pmds(mm));
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
- VM_BUG_ON_MM(mm->pmd_huge_pte, mm);
+ VM_BUG(mm->pmd_huge_pte, "%pZm", mm);
#endif
}
diff --git a/mm/gup.c b/mm/gup.c
index 0b851ac..57cc2de 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -848,7 +848,7 @@ long populate_vma_page_range(struct vm_area_struct *vma,
VM_BUG_ON(end & ~PAGE_MASK);
VM_BUG(start < vma->vm_start, "%pZv", vma);
VM_BUG(end > vma->vm_end, "%pZv", vma);
- VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_sem), mm);
+ VM_BUG(!rwsem_is_locked(&mm->mmap_sem), "%pZm", mm);
gup_flags = FOLL_TOUCH | FOLL_POPULATE;
/*
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index d4b20cd..cda190f 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2072,7 +2072,7 @@ int __khugepaged_enter(struct mm_struct *mm)
return -ENOMEM;
/* __khugepaged_exit() must not run from under us */
- VM_BUG_ON_MM(khugepaged_test_exit(mm), mm);
+ VM_BUG(khugepaged_test_exit(mm), "%pZm", mm);
if (unlikely(test_and_set_bit(MMF_VM_HUGEPAGE, &mm->flags))) {
free_mm_slot(mm_slot);
return 0;
diff --git a/mm/mmap.c b/mm/mmap.c
index f2db320..311a795 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -464,7 +464,7 @@ static void validate_mm(struct mm_struct *mm)
pr_emerg("map_count %d rb %d\n", mm->map_count, i);
bug = 1;
}
- VM_BUG_ON_MM(bug, mm);
+ VM_BUG(bug, "%pZm", mm);
}
#else
#define validate_mm_rb(root, ignore) do { } while (0)
diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 29f2f8b..952cddc 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -249,7 +249,7 @@ int walk_page_range(unsigned long start, unsigned long end,
if (!walk->mm)
return -EINVAL;
- VM_BUG_ON_MM(!rwsem_is_locked(&walk->mm->mmap_sem), walk->mm);
+ VM_BUG(!rwsem_is_locked(&walk->mm->mmap_sem), "%pZm", walk->mm);
vma = find_vma(walk->mm, start);
do {
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-04-14 20:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 20:56 [RFC 00/11] mm: debug: formatting memory management structs Sasha Levin
2015-04-14 20:56 ` [RFC 01/11] mm: debug: format flags in a buffer Sasha Levin
2015-04-30 15:39 ` Kirill A. Shutemov
2015-04-14 20:56 ` [RFC 02/11] mm: debug: deal with a new family of MM pointers Sasha Levin
2015-04-30 16:17 ` Kirill A. Shutemov
2015-04-30 16:44 ` Sasha Levin
2015-04-14 20:56 ` [RFC 03/11] mm: debug: dump VMA into a string rather than directly on screen Sasha Levin
2015-04-30 16:18 ` Kirill A. Shutemov
2015-04-14 20:56 ` [RFC 04/11] mm: debug: dump struct MM " Sasha Levin
2015-04-14 20:56 ` [RFC 05/11] mm: debug: dump page " Sasha Levin
2015-04-14 20:56 ` [RFC 06/11] mm: debug: clean unused code Sasha Levin
2015-04-14 20:56 ` [RFC 07/11] mm: debug: VM_BUG() Sasha Levin
2015-04-30 16:22 ` Kirill A. Shutemov
2015-04-14 20:56 ` [RFC 08/11] mm: debug: kill VM_BUG_ON_PAGE Sasha Levin
2015-04-14 20:56 ` [RFC 09/11] mm: debug: kill VM_BUG_ON_VMA Sasha Levin
2015-04-14 20:56 ` Sasha Levin [this message]
2015-04-14 20:56 ` [RFC 11/11] mm: debug: use VM_BUG() to help with debug output Sasha Levin
2015-04-15 8:45 ` [RFC 00/11] mm: debug: formatting memory management structs Kirill A. Shutemov
2015-04-15 12:52 ` Sasha Levin
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=1429044993-1677-11-git-send-email-sasha.levin@oracle.com \
--to=sasha.levin@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).