]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/slub.c
drivers/net: convert BUG_TRAP to generic WARN_ON
[linux-2.6-omap-h63xx.git] / mm / slub.c
index 1a427c0ae83be3d4ac58509680f38fba9948dc5d..6d4a49c1ff2fc27bef0616c03016394d551fc5be 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -411,7 +411,7 @@ static void set_track(struct kmem_cache *s, void *object,
        if (addr) {
                p->addr = addr;
                p->cpu = smp_processor_id();
-               p->pid = current ? current->pid : -1;
+               p->pid = current->pid;
                p->when = jiffies;
        } else
                memset(p, 0, sizeof(struct track));
@@ -431,9 +431,8 @@ static void print_track(const char *s, struct track *t)
        if (!t->addr)
                return;
 
-       printk(KERN_ERR "INFO: %s in ", s);
-       __print_symbol("%s", (unsigned long)t->addr);
-       printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid);
+       printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n",
+               s, t->addr, jiffies - t->when, t->cpu, t->pid);
 }
 
 static void print_tracking(struct kmem_cache *s, void *object)
@@ -493,7 +492,7 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
        if (p > addr + 16)
                print_section("Bytes b4", p - 16, 16);
 
-       print_section("Object", p, min(s->objsize, 128));
+       print_section("Object", p, min_t(unsigned long, s->objsize, PAGE_SIZE));
 
        if (s->flags & SLAB_RED_ZONE)
                print_section("Redzone", p + s->objsize,
@@ -1496,15 +1495,7 @@ static void flush_cpu_slab(void *d)
 
 static void flush_all(struct kmem_cache *s)
 {
-#ifdef CONFIG_SMP
-       on_each_cpu(flush_cpu_slab, s, 1, 1);
-#else
-       unsigned long flags;
-
-       local_irq_save(flags);
-       flush_cpu_slab(s);
-       local_irq_restore(flags);
-#endif
+       on_each_cpu(flush_cpu_slab, s, 1);
 }
 
 /*
@@ -1628,9 +1619,11 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
        void **object;
        struct kmem_cache_cpu *c;
        unsigned long flags;
+       unsigned int objsize;
 
        local_irq_save(flags);
        c = get_cpu_slab(s, smp_processor_id());
+       objsize = c->objsize;
        if (unlikely(!c->freelist || !node_match(c, node)))
 
                object = __slab_alloc(s, gfpflags, node, addr, c);
@@ -1643,7 +1636,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
        local_irq_restore(flags);
 
        if (unlikely((gfpflags & __GFP_ZERO) && object))
-               memset(object, 0, c->objsize);
+               memset(object, 0, objsize);
 
        return object;
 }
@@ -2765,6 +2758,7 @@ void kfree(const void *x)
 
        page = virt_to_head_page(x);
        if (unlikely(!PageSlab(page))) {
+               BUG_ON(!PageCompound(page));
                put_page(page);
                return;
        }