* [PATCH] SLUB: fix build when !SLUB_DEBUG
@ 2009-06-11 10:08 Alexander Beregalov
2009-06-11 11:40 ` Pekka Enberg
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Beregalov @ 2009-06-11 10:08 UTC (permalink / raw)
To: penberg, mel, Larry.Finger, linux-next; +Cc: Alexander Beregalov
Fix this build error when CONFIG_SLUB_DEBUG is not set:
mm/slub.c: In function 'slab_out_of_memory':
mm/slub.c:1551: error: 'struct kmem_cache_node' has no member named 'nr_slabs'
mm/slub.c:1552: error: 'struct kmem_cache_node' has no member named 'total_objects'
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
mm/slub.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 409e900..83c5c16 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1541,20 +1541,27 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid)
for_each_online_node(node) {
struct kmem_cache_node *n = get_node(s, node);
+ unsigned long nr_free;
+#ifdef CONFIG_SLUB_DEBUG
unsigned long nr_slabs;
unsigned long nr_objs;
- unsigned long nr_free;
+#endif
if (!n)
continue;
+ nr_free = count_partial(n, count_free);
+#ifdef CONFIG_SLUB_DEBUG
nr_slabs = atomic_long_read(&n->nr_slabs);
nr_objs = atomic_long_read(&n->total_objects);
- nr_free = count_partial(n, count_free);
printk(KERN_WARNING
" node %d: slabs: %ld, objs: %ld, free: %ld\n",
node, nr_slabs, nr_objs, nr_free);
+#else
+ printk(KERN_WARNING " node %d: free: %ld\n",
+ node, nr_free);
+#endif
}
}
--
1.6.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] SLUB: fix build when !SLUB_DEBUG
2009-06-11 10:08 [PATCH] SLUB: fix build when !SLUB_DEBUG Alexander Beregalov
@ 2009-06-11 11:40 ` Pekka Enberg
0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2009-06-11 11:40 UTC (permalink / raw)
To: Alexander Beregalov; +Cc: mel, Larry.Finger, linux-next, cl
On Thu, 2009-06-11 at 14:08 +0400, Alexander Beregalov wrote:
> Fix this build error when CONFIG_SLUB_DEBUG is not set:
> mm/slub.c: In function 'slab_out_of_memory':
> mm/slub.c:1551: error: 'struct kmem_cache_node' has no member named 'nr_slabs'
> mm/slub.c:1552: error: 'struct kmem_cache_node' has no member named 'total_objects'
>
> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
I applied the patch in slightly edited form:
http://git.kernel.org/?p=linux/kernel/git/penberg/slab-2.6.git;a=commitdiff;h=353b7a490acf04989c0e3ba57165c20b8328cb12
Thanks, Alexander!
Pekka
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-11 11:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 10:08 [PATCH] SLUB: fix build when !SLUB_DEBUG Alexander Beregalov
2009-06-11 11:40 ` Pekka Enberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox