]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/slub.c
slub statistics: Fix check for DEACTIVATE_REMOTE_FREES
[linux-2.6-omap-h63xx.git] / mm / slub.c
index ecacacdce9d7050faa2598e49d1e2992dc70507d..a96e11c77fd9595deec57b445888fde3b9bf4671 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1368,7 +1368,7 @@ static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
        struct page *page = c->page;
        int tail = 1;
 
-       if (c->freelist)
+       if (page->freelist)
                stat(c, DEACTIVATE_REMOTE_FREES);
        /*
         * Merge cpu freelist into slab freelist. Typically we get here
@@ -3564,8 +3564,8 @@ enum slab_stat_type {
 #define SO_CPU         (1 << SL_CPU)
 #define SO_OBJECTS     (1 << SL_OBJECTS)
 
-static unsigned long show_slab_objects(struct kmem_cache *s,
-                       char *buf, unsigned long flags)
+static ssize_t show_slab_objects(struct kmem_cache *s,
+                           char *buf, unsigned long flags)
 {
        unsigned long total = 0;
        int cpu;
@@ -3575,6 +3575,8 @@ static unsigned long show_slab_objects(struct kmem_cache *s,
        unsigned long *per_cpu;
 
        nodes = kzalloc(2 * sizeof(unsigned long) * nr_node_ids, GFP_KERNEL);
+       if (!nodes)
+               return -ENOMEM;
        per_cpu = nodes + nr_node_ids;
 
        for_each_possible_cpu(cpu) {