All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slab: minor cleanup to kmem_cache_alloc_node
@ 2005-11-21 14:30 Pekka J Enberg
  2005-11-21 15:58 ` Eric Dumazet
  2005-11-21 17:21 ` Christoph Lameter
  0 siblings, 2 replies; 9+ messages in thread
From: Pekka J Enberg @ 2005-11-21 14:30 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, manfred, christoph

This patch gets rid of one if-else statement by moving current node allocation
check at the beginning of kmem_cache_alloc_node().

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---

 slab.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 7f80ec3..a05bbfe 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2881,7 +2881,7 @@ void *kmem_cache_alloc_node(kmem_cache_t
 	unsigned long save_flags;
 	void *ptr;
 
-	if (nodeid == -1)
+	if (nodeid == -1 || nodeid == numa_node_id())
 		return __cache_alloc(cachep, flags);
 
 	if (unlikely(!cachep->nodelists[nodeid])) {
@@ -2892,10 +2892,7 @@ void *kmem_cache_alloc_node(kmem_cache_t
 
 	cache_alloc_debugcheck_before(cachep, flags);
 	local_irq_save(save_flags);
-	if (nodeid == numa_node_id())
-		ptr = ____cache_alloc(cachep, flags);
-	else
-		ptr = __cache_alloc_node(cachep, flags, nodeid);
+	ptr = __cache_alloc_node(cachep, flags, nodeid);
 	local_irq_restore(save_flags);
 	ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, __builtin_return_address(0));
 

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-22  6:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-21 14:30 [PATCH] slab: minor cleanup to kmem_cache_alloc_node Pekka J Enberg
2005-11-21 15:58 ` Eric Dumazet
2005-11-21 16:23   ` Pekka Enberg
2005-11-21 17:21 ` Christoph Lameter
2005-11-21 18:36   ` Pekka Enberg
2005-11-21 19:47     ` Christoph Lameter
2005-11-21 21:07       ` Pekka Enberg
2005-11-21 21:17         ` Christoph Lameter
2005-11-22  6:57           ` Pekka J Enberg

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.