From: clameter@sgi.com
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: [patch 7/8] SLUB printk cleanup: Fix up printks in the resiliency check
Date: Fri, 27 Apr 2007 13:21:44 -0700 [thread overview]
Message-ID: <20070427202901.086932505@sgi.com> (raw)
In-Reply-To: 20070427202137.613097336@sgi.com
[-- Attachment #1: slub_printk_resilience --]
[-- Type: text/plain, Size: 2576 bytes --]
---
mm/slub.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
Index: slub/mm/slub.c
===================================================================
--- slub.orig/mm/slub.c 2007-04-27 10:36:34.000000000 -0700
+++ slub/mm/slub.c 2007-04-27 10:37:42.000000000 -0700
@@ -2613,6 +2613,8 @@ __initcall(cpucache_init);
#endif
#ifdef SLUB_RESILIENCY_TEST
+static unsigned long validate_slab_cache(struct kmem_cache *s);
+
static void resiliency_test(void)
{
u8 *p;
@@ -2624,7 +2626,7 @@ static void resiliency_test(void)
p = kzalloc(16, GFP_KERNEL);
p[16] = 0x12;
printk(KERN_ERR "\n1. kmalloc-16: Clobber Redzone/next pointer"
- " 0x12->%p\n\n", p + 16);
+ " 0x12->0x%p\n\n", p + 16);
validate_slab_cache(kmalloc_caches + 4);
@@ -2632,14 +2634,14 @@ static void resiliency_test(void)
p = kzalloc(32, GFP_KERNEL);
p[32 + sizeof(void *)] = 0x34;
printk(KERN_ERR "\n2. kmalloc-32: Clobber next pointer/next slab"
- " 0x34 -> %p\n", p);
+ " 0x34 -> -0x%p\n", p);
printk(KERN_ERR "If allocated object is overwritten then not detectable\n\n");
validate_slab_cache(kmalloc_caches + 5);
p = kzalloc(64, GFP_KERNEL);
p += 64 + (get_cycles() & 0xff) * sizeof(void *);
*p = 0x56;
- printk(KERN_ERR "\n3. kmalloc-64: corrupting random byte 0x56->%p\n",
+ printk(KERN_ERR "\n3. kmalloc-64: corrupting random byte 0x56->0x%p\n",
p);
printk(KERN_ERR "If allocated object is overwritten then not detectable\n\n");
validate_slab_cache(kmalloc_caches + 6);
@@ -2648,19 +2650,19 @@ static void resiliency_test(void)
p = kzalloc(128, GFP_KERNEL);
kfree(p);
*p = 0x78;
- printk(KERN_ERR "1. kmalloc-128: Clobber first word 0x78->%p\n\n", p);
+ printk(KERN_ERR "1. kmalloc-128: Clobber first word 0x78->0x%p\n\n", p);
validate_slab_cache(kmalloc_caches + 7);
p = kzalloc(256, GFP_KERNEL);
kfree(p);
p[50] = 0x9a;
- printk(KERN_ERR "\n2. kmalloc-256: Clobber 50th byte 0x9a->%p\n\n", p);
+ printk(KERN_ERR "\n2. kmalloc-256: Clobber 50th byte 0x9a->0x%p\n\n", p);
validate_slab_cache(kmalloc_caches + 8);
p = kzalloc(512, GFP_KERNEL);
kfree(p);
p[512] = 0xab;
- printk(KERN_ERR "\n3. kmalloc-512: Clobber redzone 0xab->%p\n\n", p);
+ printk(KERN_ERR "\n3. kmalloc-512: Clobber redzone 0xab->0x%p\n\n", p);
validate_slab_cache(kmalloc_caches + 9);
}
#else
--
--
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:[~2007-04-27 20:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-27 20:21 [patch 0/8] SLUB patches vs. 2.6.21-rc7-mm2 + yesterdays accepted patches clameter
2007-04-27 20:21 ` [patch 1/8] SLUB sysfs support: fix unique id generation clameter
2007-04-27 20:21 ` [patch 2/8] SLUB: Fixes to kmem_cache_shrink() clameter
2007-04-27 20:21 ` [patch 3/8] SLUB slabinfo: Remove hackname() clameter
2007-04-27 20:21 ` [patch 4/8] SLUB printk cleanup: object_err() clameter
2007-04-27 20:21 ` [patch 5/8] SLUB printk cleanup: add slab_err clameter
2007-04-27 20:21 ` [patch 6/8] SLUB printk cleanup: Diagnostic functions clameter
2007-04-27 20:21 ` clameter [this message]
2007-04-27 20:21 ` [patch 8/8] SLUB printk cleanup: Slab validation printks clameter
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=20070427202901.086932505@sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.