diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -411,7 +411,7 @@ static void set_track(struct kmem_cache *s, void *object, | |||
411 | if (addr) { | 411 | if (addr) { |
412 | p->addr = addr; | 412 | p->addr = addr; |
413 | p->cpu = smp_processor_id(); | 413 | p->cpu = smp_processor_id(); |
414 | p->pid = current ? current->pid : -1; | 414 | p->pid = current->pid; |
415 | p->when = jiffies; | 415 | p->when = jiffies; |
416 | } else | 416 | } else |
417 | memset(p, 0, sizeof(struct track)); | 417 | memset(p, 0, sizeof(struct track)); |
@@ -431,9 +431,8 @@ static void print_track(const char *s, struct track *t) | |||
431 | if (!t->addr) | 431 | if (!t->addr) |
432 | return; | 432 | return; |
433 | 433 | ||
434 | printk(KERN_ERR "INFO: %s in ", s); | 434 | printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n", |
435 | __print_symbol("%s", (unsigned long)t->addr); | 435 | s, t->addr, jiffies - t->when, t->cpu, t->pid); |
436 | printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid); | ||
437 | } | 436 | } |
438 | 437 | ||
439 | static void print_tracking(struct kmem_cache *s, void *object) | 438 | static void print_tracking(struct kmem_cache *s, void *object) |
@@ -1497,7 +1496,7 @@ static void flush_cpu_slab(void *d) | |||
1497 | static void flush_all(struct kmem_cache *s) | 1496 | static void flush_all(struct kmem_cache *s) |
1498 | { | 1497 | { |
1499 | #ifdef CONFIG_SMP | 1498 | #ifdef CONFIG_SMP |
1500 | on_each_cpu(flush_cpu_slab, s, 1, 1); | 1499 | on_each_cpu(flush_cpu_slab, s, 1); |
1501 | #else | 1500 | #else |
1502 | unsigned long flags; | 1501 | unsigned long flags; |
1503 | 1502 | ||
@@ -1628,9 +1627,11 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1628 | void **object; | 1627 | void **object; |
1629 | struct kmem_cache_cpu *c; | 1628 | struct kmem_cache_cpu *c; |
1630 | unsigned long flags; | 1629 | unsigned long flags; |
1630 | unsigned int objsize; | ||
1631 | 1631 | ||
1632 | local_irq_save(flags); | 1632 | local_irq_save(flags); |
1633 | c = get_cpu_slab(s, smp_processor_id()); | 1633 | c = get_cpu_slab(s, smp_processor_id()); |
1634 | objsize = c->objsize; | ||
1634 | if (unlikely(!c->freelist || !node_match(c, node))) | 1635 | if (unlikely(!c->freelist || !node_match(c, node))) |
1635 | 1636 | ||
1636 | object = __slab_alloc(s, gfpflags, node, addr, c); | 1637 | object = __slab_alloc(s, gfpflags, node, addr, c); |
@@ -1643,7 +1644,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1643 | local_irq_restore(flags); | 1644 | local_irq_restore(flags); |
1644 | 1645 | ||
1645 | if (unlikely((gfpflags & __GFP_ZERO) && object)) | 1646 | if (unlikely((gfpflags & __GFP_ZERO) && object)) |
1646 | memset(object, 0, c->objsize); | 1647 | memset(object, 0, objsize); |
1647 | 1648 | ||
1648 | return object; | 1649 | return object; |
1649 | } | 1650 | } |
@@ -2765,6 +2766,7 @@ void kfree(const void *x) | |||
2765 | 2766 | ||
2766 | page = virt_to_head_page(x); | 2767 | page = virt_to_head_page(x); |
2767 | if (unlikely(!PageSlab(page))) { | 2768 | if (unlikely(!PageSlab(page))) { |
2769 | BUG_ON(!PageCompound(page)); | ||
2768 | put_page(page); | 2770 | put_page(page); |
2769 | return; | 2771 | return; |
2770 | } | 2772 | } |