All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] likely cleanup: remove unlikely for kfree(NULL)
@ 2006-04-25 18:21 Hua Zhong
  2006-04-26  7:30 ` Pekka Enberg
  0 siblings, 1 reply; 32+ messages in thread
From: Hua Zhong @ 2006-04-25 18:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

On my system, it shows about 84K misses and 67K hits. So there are more kfree(NULL) than people realize.

I know some people won't like it, but I think it's not worth the confusion and maintenance burden, so I'm giving it a shot. :-)

Signed-off-by: Hua Zhong <hzhong@gmail.com>

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
diff --git a/mm/slab.c b/mm/slab.c
index e6ef9bd..0fbc854 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3380,7 +3380,7 @@ void kfree(const void *objp)
  	struct kmem_cache *c;
  	unsigned long flags;

-	if (unlikely(!objp))
+	if (!objp)
  		return;
  	local_irq_save(flags);
  	kfree_debugcheck(objp);

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

end of thread, other threads:[~2006-04-27 18:30 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-25 18:21 [PATCH] likely cleanup: remove unlikely for kfree(NULL) Hua Zhong
2006-04-26  7:30 ` Pekka Enberg
2006-04-26  7:53   ` Andreas Mohr
2006-04-26  7:58   ` Arjan van de Ven
2006-04-26  8:16     ` Pekka J Enberg
2006-04-26  8:27       ` Arjan van de Ven
2006-04-26 10:05         ` Adrian Bunk
2006-04-26 10:05         ` Jörn Engel
2006-04-26 10:08           ` Arjan van de Ven
2006-04-26 10:57             ` Pekka J Enberg
2006-04-26 11:03               ` Arjan van de Ven
2006-04-26 11:06                 ` Jörn Engel
2006-04-26 11:37                   ` Bart Hartgers
2006-04-26 13:04                     ` Bart Hartgers
2006-04-26 19:07                       ` Kyle Moffett
2006-04-27  6:28                         ` Pekka J Enberg
2006-04-27  6:37                           ` Nick Piggin
2006-04-27  8:17                         ` Bart Hartgers
2006-04-27 15:23                           ` Kyle Moffett
2006-04-26 14:11                   ` Pekka J Enberg
2006-04-27  5:54                   ` Pekka J Enberg
2006-04-27  6:17                     ` Nick Piggin
2006-04-27  6:28                       ` Pekka J Enberg
2006-04-27  6:50                         ` Arjan van de Ven
2006-04-27  8:31                           ` Adrian Bunk
2006-04-27  8:41                             ` Arjan van de Ven
2006-04-27  8:56                               ` Adrian Bunk
2006-04-27  9:08                                 ` Arjan van de Ven
2006-04-27 11:41                                   ` Bart Hartgers
2006-04-27 18:23                                   ` Adrian Bunk
2006-04-27 18:29                                     ` Arjan van de Ven
2006-04-26 11:05               ` Nick Piggin

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.