aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 17f859614546..910df6326831 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2306,8 +2306,9 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
2306 } 2306 }
2307#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC) 2307#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
2308 if (size >= kmalloc_size(INDEX_NODE + 1) 2308 if (size >= kmalloc_size(INDEX_NODE + 1)
2309 && cachep->object_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) { 2309 && cachep->object_size > cache_line_size()
2310 cachep->obj_offset += PAGE_SIZE - ALIGN(size, align); 2310 && ALIGN(size, cachep->align) < PAGE_SIZE) {
2311 cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
2311 size = PAGE_SIZE; 2312 size = PAGE_SIZE;
2312 } 2313 }
2313#endif 2314#endif
@@ -4377,7 +4378,7 @@ static int leaks_show(struct seq_file *m, void *p)
4377 struct slab *slabp; 4378 struct slab *slabp;
4378 struct kmem_cache_node *n; 4379 struct kmem_cache_node *n;
4379 const char *name; 4380 const char *name;
4380 unsigned long *n = m->private; 4381 unsigned long *x = m->private;
4381 int node; 4382 int node;
4382 int i; 4383 int i;
4383 4384
@@ -4388,7 +4389,7 @@ static int leaks_show(struct seq_file *m, void *p)
4388 4389
4389 /* OK, we can do it */ 4390 /* OK, we can do it */
4390 4391
4391 n[1] = 0; 4392 x[1] = 0;
4392 4393
4393 for_each_online_node(node) { 4394 for_each_online_node(node) {
4394 n = cachep->node[node]; 4395 n = cachep->node[node];
@@ -4399,32 +4400,32 @@ static int leaks_show(struct seq_file *m, void *p)
4399 spin_lock_irq(&n->list_lock); 4400 spin_lock_irq(&n->list_lock);
4400 4401
4401 list_for_each_entry(slabp, &n->slabs_full, list) 4402 list_for_each_entry(slabp, &n->slabs_full, list)
4402 handle_slab(n, cachep, slabp); 4403 handle_slab(x, cachep, slabp);
4403 list_for_each_entry(slabp, &n->slabs_partial, list) 4404 list_for_each_entry(slabp, &n->slabs_partial, list)
4404 handle_slab(n, cachep, slabp); 4405 handle_slab(x, cachep, slabp);
4405 spin_unlock_irq(&n->list_lock); 4406 spin_unlock_irq(&n->list_lock);
4406 } 4407 }
4407 name = cachep->name; 4408 name = cachep->name;
4408 if (n[0] == n[1]) { 4409 if (x[0] == x[1]) {
4409 /* Increase the buffer size */ 4410 /* Increase the buffer size */
4410 mutex_unlock(&slab_mutex); 4411 mutex_unlock(&slab_mutex);
4411 m->private = kzalloc(n[0] * 4 * sizeof(unsigned long), GFP_KERNEL); 4412 m->private = kzalloc(x[0] * 4 * sizeof(unsigned long), GFP_KERNEL);
4412 if (!m->private) { 4413 if (!m->private) {
4413 /* Too bad, we are really out */ 4414 /* Too bad, we are really out */
4414 m->private = n; 4415 m->private = x;
4415 mutex_lock(&slab_mutex); 4416 mutex_lock(&slab_mutex);
4416 return -ENOMEM; 4417 return -ENOMEM;
4417 } 4418 }
4418 *(unsigned long *)m->private = n[0] * 2; 4419 *(unsigned long *)m->private = x[0] * 2;
4419 kfree(n); 4420 kfree(x);
4420 mutex_lock(&slab_mutex); 4421 mutex_lock(&slab_mutex);
4421 /* Now make sure this entry will be retried */ 4422 /* Now make sure this entry will be retried */
4422 m->count = m->size; 4423 m->count = m->size;
4423 return 0; 4424 return 0;
4424 } 4425 }
4425 for (i = 0; i < n[1]; i++) { 4426 for (i = 0; i < x[1]; i++) {
4426 seq_printf(m, "%s: %lu ", name, n[2*i+3]); 4427 seq_printf(m, "%s: %lu ", name, x[2*i+3]);
4427 show_symbol(m, n[2*i+2]); 4428 show_symbol(m, x[2*i+2]);
4428 seq_putc(m, '\n'); 4429 seq_putc(m, '\n');
4429 } 4430 }
4430 4431