public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mm: slab - __cache_alloc NULL prefetch fix
@ 2008-11-20 16:44 Cyrill Gorcunov
  2008-11-20 17:01 ` Cyrill Gorcunov
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Cyrill Gorcunov @ 2008-11-20 16:44 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg; +Cc: LKML, Andrew Morton

Do not prefetch NULL

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Please check

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

Index: linux-2.6.git/mm/slab.c
===================================================================
--- linux-2.6.git.orig/mm/slab.c
+++ linux-2.6.git/mm/slab.c
@@ -3395,10 +3395,11 @@ __cache_alloc(struct kmem_cache *cachep,
 	objp = __do_cache_alloc(cachep, flags);
 	local_irq_restore(save_flags);
 	objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller);
-	prefetchw(objp);
 
-	if (likely(objp))
+	if (likely(objp)) {
+		prefetchw(objp);
 		kmemcheck_slab_alloc(cachep, flags, objp, obj_size(cachep));
+	}
 
 	if (unlikely((flags & __GFP_ZERO) && objp))
 		memset(objp, 0, obj_size(cachep));

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

end of thread, other threads:[~2008-11-20 20:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20 16:44 mm: slab - __cache_alloc NULL prefetch fix Cyrill Gorcunov
2008-11-20 17:01 ` Cyrill Gorcunov
2008-11-20 18:16   ` Christoph Lameter
2008-11-20 18:24     ` Cyrill Gorcunov
2008-11-20 18:15 ` Christoph Lameter
2008-11-20 19:58 ` Valdis.Kletnieks
2008-11-20 20:03   ` Pekka Enberg
2008-11-20 20:10   ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox