Re: [PATCH] slub: /proc/slabinfo ABI compatibility
From: Ingo Molnar
Date: Sat Dec 22 2007 - 08:37:53 EST
* Ingo Molnar <mingo@xxxxxxx> wrote:
> > From: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
> >
> > This adds a read-only /proc/slabinfo file that is ABI compatible with
> > SLAB for SLUB.
> >
> > Cc: Ingo Molnar <mingo@xxxxxxx>
>
> Tested-by: Ingo Molnar <mingo@xxxxxxx>
Pekka, i stuck your patch into the x86.git random-test-grid, and it
found the following build error after a few iterations:
mm/slub.c: In function 's_show':
mm/slub.c:4188: error: implicit declaration of function 'count_partial'
find the (tested) fix below.
Ingo
----------------->
Subject: SLUB: build fix
From: Ingo Molnar <mingo@xxxxxxx>
fix:
mm/slub.c: In function 's_show':
mm/slub.c:4188: error: implicit declaration of function 'count_partial'
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
mm/slub.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
Index: linux/mm/slub.c
===================================================================
--- linux.orig/mm/slub.c
+++ linux/mm/slub.c
@@ -3079,6 +3079,19 @@ void *__kmalloc_node_track_caller(size_t
return slab_alloc(s, gfpflags, node, caller);
}
+static unsigned long count_partial(struct kmem_cache_node *n)
+{
+ unsigned long flags;
+ unsigned long x = 0;
+ struct page *page;
+
+ spin_lock_irqsave(&n->list_lock, flags);
+ list_for_each_entry(page, &n->partial, lru)
+ x += page->inuse;
+ spin_unlock_irqrestore(&n->list_lock, flags);
+ return x;
+}
+
#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)
static int validate_slab(struct kmem_cache *s, struct page *page,
unsigned long *map)
@@ -3464,19 +3477,6 @@ static int list_locations(struct kmem_ca
return n;
}
-static unsigned long count_partial(struct kmem_cache_node *n)
-{
- unsigned long flags;
- unsigned long x = 0;
- struct page *page;
-
- spin_lock_irqsave(&n->list_lock, flags);
- list_for_each_entry(page, &n->partial, lru)
- x += page->inuse;
- spin_unlock_irqrestore(&n->list_lock, flags);
- return x;
-}
-
enum slab_stat_type {
SL_FULL,
SL_PARTIAL,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/