All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <elezegarcia@gmail.com>
To: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Cc: Ezequiel Garcia <elezegarcia@gmail.com>,
	Pekka Enberg <penberg@kernel.org>
Subject: [PATCH 03/10] mm, slab: Remove silly function slab_buffer_size()
Date: Sat,  8 Sep 2012 17:47:52 -0300	[thread overview]
Message-ID: <1347137279-17568-3-git-send-email-elezegarcia@gmail.com> (raw)
In-Reply-To: <1347137279-17568-1-git-send-email-elezegarcia@gmail.com>

This function is seldom used, and can be simply replaced with cachep->size.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 include/linux/slab_def.h |    5 -----
 mm/slab.c                |   12 ++----------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 36d7031..604ebc8 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -113,17 +113,12 @@ void *__kmalloc(size_t size, gfp_t flags);
 #ifdef CONFIG_TRACING
 extern void *kmem_cache_alloc_trace(size_t size,
 				    struct kmem_cache *cachep, gfp_t flags);
-extern size_t slab_buffer_size(struct kmem_cache *cachep);
 #else
 static __always_inline void *
 kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags)
 {
 	return kmem_cache_alloc(cachep, flags);
 }
-static inline size_t slab_buffer_size(struct kmem_cache *cachep)
-{
-	return 0;
-}
 #endif
 
 static __always_inline void *kmalloc(size_t size, gfp_t flags)
diff --git a/mm/slab.c b/mm/slab.c
index 3b4587b..53e41de 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -498,14 +498,6 @@ static void **dbg_userword(struct kmem_cache *cachep, void *objp)
 
 #endif
 
-#ifdef CONFIG_TRACING
-size_t slab_buffer_size(struct kmem_cache *cachep)
-{
-	return cachep->size;
-}
-EXPORT_SYMBOL(slab_buffer_size);
-#endif
-
 /*
  * Do not go above this order unless 0 objects fit into the slab or
  * overridden on the command line.
@@ -3849,7 +3841,7 @@ kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags)
 	ret = __cache_alloc(cachep, flags, __builtin_return_address(0));
 
 	trace_kmalloc(_RET_IP_, ret,
-		      size, slab_buffer_size(cachep), flags);
+		      size, cachep->size, flags);
 	return ret;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_trace);
@@ -3880,7 +3872,7 @@ void *kmem_cache_alloc_node_trace(size_t size,
 	ret = __cache_alloc_node(cachep, flags, nodeid,
 				  __builtin_return_address(0));
 	trace_kmalloc_node(_RET_IP_, ret,
-			   size, slab_buffer_size(cachep),
+			   size, cachep->size,
 			   flags, nodeid);
 	return ret;
 }
-- 
1.7.8.6


WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <elezegarcia@gmail.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Ezequiel Garcia <elezegarcia@gmail.com>,
	Pekka Enberg <penberg@kernel.org>
Subject: [PATCH 03/10] mm, slab: Remove silly function slab_buffer_size()
Date: Sat,  8 Sep 2012 17:47:52 -0300	[thread overview]
Message-ID: <1347137279-17568-3-git-send-email-elezegarcia@gmail.com> (raw)
In-Reply-To: <1347137279-17568-1-git-send-email-elezegarcia@gmail.com>

This function is seldom used, and can be simply replaced with cachep->size.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 include/linux/slab_def.h |    5 -----
 mm/slab.c                |   12 ++----------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 36d7031..604ebc8 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -113,17 +113,12 @@ void *__kmalloc(size_t size, gfp_t flags);
 #ifdef CONFIG_TRACING
 extern void *kmem_cache_alloc_trace(size_t size,
 				    struct kmem_cache *cachep, gfp_t flags);
-extern size_t slab_buffer_size(struct kmem_cache *cachep);
 #else
 static __always_inline void *
 kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags)
 {
 	return kmem_cache_alloc(cachep, flags);
 }
-static inline size_t slab_buffer_size(struct kmem_cache *cachep)
-{
-	return 0;
-}
 #endif
 
 static __always_inline void *kmalloc(size_t size, gfp_t flags)
diff --git a/mm/slab.c b/mm/slab.c
index 3b4587b..53e41de 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -498,14 +498,6 @@ static void **dbg_userword(struct kmem_cache *cachep, void *objp)
 
 #endif
 
-#ifdef CONFIG_TRACING
-size_t slab_buffer_size(struct kmem_cache *cachep)
-{
-	return cachep->size;
-}
-EXPORT_SYMBOL(slab_buffer_size);
-#endif
-
 /*
  * Do not go above this order unless 0 objects fit into the slab or
  * overridden on the command line.
@@ -3849,7 +3841,7 @@ kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags)
 	ret = __cache_alloc(cachep, flags, __builtin_return_address(0));
 
 	trace_kmalloc(_RET_IP_, ret,
-		      size, slab_buffer_size(cachep), flags);
+		      size, cachep->size, flags);
 	return ret;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_trace);
@@ -3880,7 +3872,7 @@ void *kmem_cache_alloc_node_trace(size_t size,
 	ret = __cache_alloc_node(cachep, flags, nodeid,
 				  __builtin_return_address(0));
 	trace_kmalloc_node(_RET_IP_, ret,
-			   size, slab_buffer_size(cachep),
+			   size, cachep->size,
 			   flags, nodeid);
 	return ret;
 }
-- 
1.7.8.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-09-08 20:50 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08 20:47 [PATCH 01/10] Makefile: Add option CONFIG_DISABLE_GCC_AUTOMATIC_INLINING Ezequiel Garcia
2012-09-08 20:47 ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 02/10] mm, slob: Use NUMA_NO_NODE instead of -1 Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-09 21:27   ` David Rientjes
2012-09-09 21:27     ` David Rientjes
2012-09-24 17:13     ` Ezequiel Garcia
2012-09-24 17:13       ` Ezequiel Garcia
2012-09-25  7:37       ` Pekka Enberg
2012-09-25  7:37         ` Pekka Enberg
2012-09-25 10:13         ` Ezequiel Garcia
2012-09-25 10:13           ` Ezequiel Garcia
2012-09-08 20:47 ` Ezequiel Garcia [this message]
2012-09-08 20:47   ` [PATCH 03/10] mm, slab: Remove silly function slab_buffer_size() Ezequiel Garcia
2012-09-09 21:28   ` David Rientjes
2012-09-09 21:28     ` David Rientjes
2012-09-08 20:47 ` [PATCH 04/10] mm, slob: Add support for kmalloc_track_caller() Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-25 19:53   ` [patch slab/next] mm, slob: fix build breakage in __kmalloc_node_track_caller David Rientjes
2012-09-25 19:53     ` David Rientjes
2012-09-25 19:55     ` Ezequiel Garcia
2012-09-25 19:55       ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 05/10] mm, util: Use dup_user to duplicate user memory Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-25  7:15   ` Pekka Enberg
2012-09-25  7:15     ` Pekka Enberg
2012-09-25 21:29   ` Andrew Morton
2012-09-25 21:29     ` Andrew Morton
2012-09-26  1:15     ` Ezequiel Garcia
2012-09-26  1:15       ` Ezequiel Garcia
2012-09-26 21:42       ` Andrew Morton
2012-09-26 21:42         ` Andrew Morton
2012-09-26 21:51         ` Ezequiel Garcia
2012-09-26 21:51           ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 06/10] mm, slab: Replace 'caller' type, void* -> unsigned long Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 07/10] mm, slab: Match SLAB and SLUB kmem_cache_alloc_xxx_trace() prototype Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 08/10] mm, slab: Rename __cache_alloc() -> slab_alloc() Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 09/10] mm, slub: Rename slab_alloc() -> slab_alloc_node() to match SLAB Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-08 20:47 ` [PATCH 10/10] mm: Factor SLAB and SLUB common code Ezequiel Garcia
2012-09-08 20:47   ` Ezequiel Garcia
2012-09-08 21:43 ` [PATCH 01/10] Makefile: Add option CONFIG_DISABLE_GCC_AUTOMATIC_INLINING Sam Ravnborg
2012-09-08 21:43   ` Sam Ravnborg
2012-09-09 21:25 ` David Rientjes
2012-09-09 21:25   ` David Rientjes
2012-09-13  0:30   ` Ezequiel Garcia
2012-09-13  0:30     ` Ezequiel Garcia
2012-09-13  7:17     ` Michal Marek
2012-09-13  7:17       ` Michal Marek
2012-09-13  9:16       ` Ezequiel Garcia
2012-09-13  9:16         ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347137279-17568-3-git-send-email-elezegarcia@gmail.com \
    --to=elezegarcia@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.