Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269298
b: refs/heads/master
c: d20bbfa
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Enberg committed Sep 19, 2011
1 parent dc7dabb commit 5921fd7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 50 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 136333d104bd3a62d783b0ac3d0f32ac0108c5d0
refs/heads/master: d20bbfab01802e195a50435940f7e4aa747c217c
2 changes: 0 additions & 2 deletions trunk/Documentation/vm/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ page_migration
- description of page migration in NUMA systems.
pagemap.txt
- pagemap, from the userspace perspective
slabinfo.c
- source code for a tool to get reports about slabs.
slub.txt
- a short users guide for SLUB.
unevictable-lru.txt
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/vm/slub.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ data and perform operation on the slabs. By default slabinfo only lists
slabs that have data in them. See "slabinfo -h" for more options when
running the command. slabinfo can be compiled with

gcc -o slabinfo Documentation/vm/slabinfo.c
gcc -o slabinfo tools/slub/slabinfo.c

Some of the modes of operation of slabinfo require that slub debugging
be enabled on the command line. F.e. no tracking information will be
Expand Down
17 changes: 6 additions & 11 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,15 +1851,15 @@ static void dump_line(char *data, int offset, int limit)
unsigned char error = 0;
int bad_count = 0;

printk(KERN_ERR "%03x:", offset);
printk(KERN_ERR "%03x: ", offset);
for (i = 0; i < limit; i++) {
if (data[offset + i] != POISON_FREE) {
error = data[offset + i];
bad_count++;
}
printk(" %02x", (unsigned char)data[offset + i]);
}
printk("\n");
print_hex_dump(KERN_CONT, "", 0, 16, 1,
&data[offset], limit, 1);

if (bad_count == 1) {
error ^= POISON_FREE;
Expand Down Expand Up @@ -3039,14 +3039,9 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp)
printk(KERN_ERR "slab: Internal list corruption detected in "
"cache '%s'(%d), slabp %p(%d). Hexdump:\n",
cachep->name, cachep->num, slabp, slabp->inuse);
for (i = 0;
i < sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t);
i++) {
if (i % 16 == 0)
printk("\n%03x:", i);
printk(" %02x", ((unsigned char *)slabp)[i]);
}
printk("\n");
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, slabp,
sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t),
1);
BUG();
}
}
Expand Down
44 changes: 9 additions & 35 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,34 +467,8 @@ static int disable_higher_order_debug;
*/
static void print_section(char *text, u8 *addr, unsigned int length)
{
int i, offset;
int newline = 1;
char ascii[17];

ascii[16] = 0;

for (i = 0; i < length; i++) {
if (newline) {
printk(KERN_ERR "%8s 0x%p: ", text, addr + i);
newline = 0;
}
printk(KERN_CONT " %02x", addr[i]);
offset = i % 16;
ascii[offset] = isgraph(addr[i]) ? addr[i] : '.';
if (offset == 15) {
printk(KERN_CONT " %s\n", ascii);
newline = 1;
}
}
if (!newline) {
i %= 16;
while (i < 16) {
printk(KERN_CONT " ");
ascii[i] = ' ';
i++;
}
printk(KERN_CONT " %s\n", ascii);
}
print_hex_dump(KERN_ERR, text, DUMP_PREFIX_ADDRESS, 16, 1, addr,
length, 1);
}

static struct track *get_track(struct kmem_cache *s, void *object,
Expand Down Expand Up @@ -625,12 +599,12 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
p, p - addr, get_freepointer(s, p));

if (p > addr + 16)
print_section("Bytes b4", p - 16, 16);

print_section("Object", p, min_t(unsigned long, s->objsize, PAGE_SIZE));
print_section("Bytes b4 ", p - 16, 16);

print_section("Object ", p, min_t(unsigned long, s->objsize,
PAGE_SIZE));
if (s->flags & SLAB_RED_ZONE)
print_section("Redzone", p + s->objsize,
print_section("Redzone ", p + s->objsize,
s->inuse - s->objsize);

if (s->offset)
Expand All @@ -643,7 +617,7 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)

if (off != s->size)
/* Beginning of the filler is the free pointer */
print_section("Padding", p + off, s->size - off);
print_section("Padding ", p + off, s->size - off);

dump_stack();
}
Expand Down Expand Up @@ -838,7 +812,7 @@ static int slab_pad_check(struct kmem_cache *s, struct page *page)
end--;

slab_err(s, page, "Padding overwritten. 0x%p-0x%p", fault, end - 1);
print_section("Padding", end - remainder, remainder);
print_section("Padding ", end - remainder, remainder);

restore_bytes(s, "slab padding", POISON_INUSE, end - remainder, end);
return 0;
Expand Down Expand Up @@ -987,7 +961,7 @@ static void trace(struct kmem_cache *s, struct page *page, void *object,
page->freelist);

if (!alloc)
print_section("Object", (void *)object, s->objsize);
print_section("Object ", (void *)object, s->objsize);

dump_stack();
}
Expand Down

0 comments on commit 5921fd7

Please sign in to comment.