Josh Boyer 34f9218
From 77c78bac236c7b07d390be65f357c85a79cce890 Mon Sep 17 00:00:00 2001
Josh Boyer 34f9218
From: Dave Jones <davej@redhat.com>
Josh Boyer 34f9218
Date: Wed, 26 Oct 2011 18:44:26 -0400
Josh Boyer 34f9218
Subject: [PATCH] Add more debugging information to the VM subsystem
Josh Boyer 34f9218
Josh Boyer 34f9218
Dump modules in bad_page, and print taint information in other areas
Josh Boyer 34f9218
---
Josh Boyer 34f9218
 mm/page_alloc.c |    1 +
Josh Boyer 34f9218
 mm/slab.c       |    8 ++++----
Josh Boyer 34f9218
 mm/slub.c       |    2 +-
Josh Boyer 34f9218
 3 files changed, 6 insertions(+), 5 deletions(-)
Josh Boyer 34f9218
Dave Jones c0bd078
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
Josh Boyer 34f9218
index 6e8ecb6..83a0205 100644
Dave Jones c0bd078
--- a/mm/page_alloc.c
Dave Jones c0bd078
+++ b/mm/page_alloc.c
Dave Jones c0bd078
@@ -318,6 +318,7 @@ static void bad_page(struct page *page)
Dave Jones c0bd078
 		current->comm, page_to_pfn(page));
Dave Jones c0bd078
 	dump_page(page);
Jesse Keating 7a32965
 
Dave Jones c0bd078
+	print_modules();
Dave Jones c0bd078
 	dump_stack();
Dave Jones c0bd078
 out:
Dave Jones c0bd078
 	/* Leave bad fields for debug, except PageBuddy could make trouble */
Jesse Keating 7a32965
diff --git a/mm/slab.c b/mm/slab.c
Josh Boyer 34f9218
index 708efe8..114a66d 100644
Jesse Keating 7a32965
--- a/mm/slab.c
Jesse Keating 7a32965
+++ b/mm/slab.c
Josh Boyer 34f9218
@@ -1927,8 +1927,8 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp)
Jesse Keating 7a32965
 			/* Print header */
Jesse Keating 7a32965
 			if (lines == 0) {
Jesse Keating 7a32965
 				printk(KERN_ERR
Jesse Keating 7a32965
-					"Slab corruption: %s start=%p, len=%d\n",
Jesse Keating 7a32965
-					cachep->name, realobj, size);
Jesse Keating 7a32965
+					"Slab corruption (%s): %s start=%p, len=%d\n",
Jesse Keating 7a32965
+					print_tainted(), cachep->name, realobj, size);
Jesse Keating 7a32965
 				print_objinfo(cachep, objp, 0);
Jesse Keating 7a32965
 			}
Jesse Keating 7a32965
 			/* Hexdump the affected line */
Josh Boyer 34f9218
@@ -3037,8 +3037,8 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp)
Jesse Keating 7a32965
 	if (entries != cachep->num - slabp->inuse) {
Jesse Keating 7a32965
 bad:
Jesse Keating 7a32965
 		printk(KERN_ERR "slab: Internal list corruption detected in "
Jesse Keating 7a32965
-				"cache '%s'(%d), slabp %p(%d). Hexdump:\n",
Jesse Keating 7a32965
-			cachep->name, cachep->num, slabp, slabp->inuse);
Josh Boyer 34f9218
+				"cache '%s'(%d), slabp %p(%d). Tainted(%s) Hexdump:\n",
Jesse Keating 7a32965
+			cachep->name, cachep->num, slabp, slabp->inuse, print_tainted());
Josh Boyer 34f9218
 		print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, slabp,
Josh Boyer 34f9218
 			sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t),
Josh Boyer 34f9218
 			1);
Jesse Keating 7a32965
diff --git a/mm/slub.c b/mm/slub.c
Josh Boyer 34f9218
index 95215aa..bbec29e 100644
Jesse Keating 7a32965
--- a/mm/slub.c
Jesse Keating 7a32965
+++ b/mm/slub.c
Josh Boyer 34f9218
@@ -570,7 +570,7 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...)
Jesse Keating 7a32965
 	va_end(args);
Jesse Keating 7a32965
 	printk(KERN_ERR "========================================"
Jesse Keating 7a32965
 			"=====================================\n");
Jesse Keating 7a32965
-	printk(KERN_ERR "BUG %s: %s\n", s->name, buf);
Jesse Keating 7a32965
+	printk(KERN_ERR "BUG %s (%s): %s\n", s->name, print_tainted(), buf);
Jesse Keating 7a32965
 	printk(KERN_ERR "----------------------------------------"
Jesse Keating 7a32965
 			"-------------------------------------\n\n");
Jesse Keating 7a32965
 }
Josh Boyer 34f9218
-- 
Josh Boyer 34f9218
1.7.6.4
Josh Boyer 34f9218