SLUB: fix build when !SLUB_DEBUG
Subsystems (3)
PATCH 1/1 SLUB: fix build when !SLUB_DEBUG
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 <[email protected]>
--- mm/slub.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
mm/slub.c +9 -2
@@ -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 } }
Signature · 1 line
1.6.3.1
Quoted 6 lines · Alexander Beregalov
Fix this build error when
CONFIG_SLUB_DEBUGis not set:mm/slub.c: In function 'slab_out_of_memory':mm/slub.c:1551: error: 'structkmem_cache_node' has no member named 'nr_slabs'mm/slub.c:1552: error: 'structkmem_cache_node' has no member named 'total_objects'Signed-off-by Alexander Beregalov <[email protected]>
I applied the patch in slightly edited form:
Thanks, Alexander!
Pekka