Re: [3.11 3/4] Move kmalloc_node functions to common code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 18 Jun 2013, Pekka Enberg wrote:

> I'm seeing this after "make defconfig" on x86-64:
>
>   CC      mm/slub.o
> mm/slub.c:2445:7: error: conflicting types for �kmem_cache_alloc_node_trace�
> include/linux/slab.h:311:14: note: previous declaration of
> �kmem_cache_alloc_node_trace� was here
> mm/slub.c:2455:1: error: conflicting types for �kmem_cache_alloc_node_trace�
> include/linux/slab.h:311:14: note: previous declaration of
> �kmem_cache_alloc_node_trace� was here
> make[1]: *** [mm/slub.o] Error 1
> make: *** [mm/slub.o] Error 2

Gosh I dropped the size_t parameter from these functions. CONFIG_TRACING
needs these.


Subject: Fix kmem_cache_alloc*_trace parameters

The size parameter is needed.

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Index: linux/include/linux/slab.h
===================================================================
--- linux.orig/include/linux/slab.h	2013-06-18 11:45:22.472313944 -0500
+++ linux/include/linux/slab.h	2013-06-18 11:53:29.816926981 -0500
@@ -313,12 +313,12 @@ static __always_inline void *kmem_cache_
 #ifdef CONFIG_TRACING
 extern void *kmem_cache_alloc_node_trace(struct kmem_cache *s,
 					   gfp_t gfpflags,
-					   int node);
+					   int node, size_t size);
 #else
 static __always_inline void *
 kmem_cache_alloc_node_trace(struct kmem_cache *s,
 			      gfp_t gfpflags,
-			      int node)
+			      int node, size_t size)
 {
 	return kmem_cache_alloc_node(s, gfpflags, node);
 }
@@ -360,10 +360,10 @@ static __always_inline void *kmalloc_lar
 }

 #ifdef CONFIG_TRACING
-extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t);
+extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
 #else
 static __always_inline void *kmem_cache_alloc_trace(struct kmem_cache *s,
-		gfp_t flags)
+		gfp_t flags, size_t size)
 {
 	return kmem_cache_alloc(s, flags);
 }
@@ -390,7 +390,7 @@ static __always_inline void *kmalloc(siz
 				return ZERO_SIZE_PTR;

 			return kmem_cache_alloc_trace(kmalloc_caches[index],
-					flags);
+					flags, size);
 		}
 #endif
 	}
@@ -428,7 +428,7 @@ static __always_inline void *kmalloc_nod
 			return ZERO_SIZE_PTR;

 		return kmem_cache_alloc_node_trace(kmalloc_caches[i],
-			       			flags, node);
+			       			flags, node, size);
 	}
 #endif
 	return __kmalloc_node(size, flags, node);
Index: linux/mm/slab.c
===================================================================
--- linux.orig/mm/slab.c	2013-06-18 11:45:15.984199533 -0500
+++ linux/mm/slab.c	2013-06-18 11:54:23.857883936 -0500
@@ -3681,7 +3681,7 @@ __do_kmalloc_node(size_t size, gfp_t fla
 	cachep = kmalloc_slab(size, flags);
 	if (unlikely(ZERO_OR_NULL_PTR(cachep)))
 		return cachep;
-	return kmem_cache_alloc_node_trace(cachep, flags, node);
+	return kmem_cache_alloc_node_trace(cachep, flags, node, size);
 }

 #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_TRACING)

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]