lkml.org 
[lkml]   [2007]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] slub: /proc/slabinfo ABI compatibility

* Ingo Molnar <mingo@elte.hu> wrote:

> > From: Pekka Enberg <penberg@cs.helsinki.fi>
> >
> > This adds a read-only /proc/slabinfo file that is ABI compatible with
> > SLAB for SLUB.
> >
> > Cc: Ingo Molnar <mingo@elte.hu>
>
> Tested-by: Ingo Molnar <mingo@elte.hu>

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@elte.hu>

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@elte.hu>
---
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,

\
 
 \ /
  Last update: 2007-12-22 14:41    [W:0.111 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site