linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the kmemcheck tree with the kmemleak tree
@ 2009-06-01  7:55 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-01  7:55 UTC (permalink / raw)
  To: Vegard Nossum, Pekka Enberg, Ingo Molnar
  Cc: linux-next, linux-kernel, Catalin Marinas

Hi all,

Today's linux-next merge of the kmemcheck tree got a conflict in
include/linux/slab.h between commit
5b1173b0ea49874431e1d5f07c57a373a26f75f1 ("kmemleak: Add the slab memory
allocation/freeing hooks") from the kmemleak tree and commit e6df1035b1b488cafde1e69f1a25f2706c3ac1f7 ("kmemcheck: add mm functions") from
the kmemcheck tree.

Overlapping additions.  One of you is going to have to choose a different
value for your defines.  I fixed it up by making the kmemcheck one bigger
(see below) and can carry the for as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc include/linux/slab.h
index 76f21a6,1b969fa..0000000
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@@ -62,8 -62,13 +62,15 @@@
  # define SLAB_DEBUG_OBJECTS	0x00000000UL
  #endif
  
 +#define SLAB_NOLEAKTRACE	0x00800000UL	/* Avoid kmemleak tracing */
 +
+ /* Don't track use of uninitialized memory */
+ #ifdef CONFIG_KMEMCHECK
 -# define SLAB_NOTRACK		0x00800000UL
++# define SLAB_NOTRACK		0x01000000UL
+ #else
+ # define SLAB_NOTRACK		0x00000000UL
+ #endif
+ 
  /* The following flags affect the page allocator grouping pages by mobility */
  #define SLAB_RECLAIM_ACCOUNT	0x00020000UL		/* Objects are reclaimable */
  #define SLAB_TEMPORARY		SLAB_RECLAIM_ACCOUNT	/* Objects are short-lived */

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

* linux-next: manual merge of the kmemcheck tree with the kmemleak tree
@ 2009-06-01  7:55 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-01  7:55 UTC (permalink / raw)
  To: Vegard Nossum, Pekka Enberg, Ingo Molnar
  Cc: linux-next, linux-kernel, Catalin Marinas

Hi all,

Today's linux-next merge of the kmemcheck tree got a conflict in
mm/slab.c between commit 5b1173b0ea49874431e1d5f07c57a373a26f75f1
("kmemleak: Add the slab memory allocation/freeing hooks") from the
kmemleak tree and commit 30532cb3c49a2a9fed94127aab26003c52398a51 ("slab:
add hooks for kmemcheck") from the kmemcheck tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc mm/slab.c
index eb96d3b,6bf8a95..0000000
--- a/mm/slab.c
+++ b/mm/slab.c
@@@ -179,13 -179,13 +180,13 @@@
  			 SLAB_STORE_USER | \
  			 SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \
  			 SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD | \
- 			 SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE)
 -			 SLAB_DEBUG_OBJECTS | SLAB_NOTRACK)
++			 SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE | SLAB_NOTRACK)
  #else
  # define CREATE_MASK	(SLAB_HWCACHE_ALIGN | \
  			 SLAB_CACHE_DMA | \
  			 SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \
  			 SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD | \
- 			 SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE)
 -			 SLAB_DEBUG_OBJECTS | SLAB_NOTRACK)
++			 SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE | SLAB_NOTRACK)
  #endif
  
  /*
@@@ -3392,9 -3292,10 +3324,12 @@@ __cache_alloc_node(struct kmem_cache *c
    out:
  	local_irq_restore(save_flags);
  	ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
 +	kmemleak_alloc_recursive(ptr, obj_size(cachep), 1, cachep->flags,
 +				 flags);
  
+ 	if (likely(ptr))
+ 		kmemcheck_slab_alloc(cachep, flags, ptr, obj_size(cachep));
+ 
  	if (unlikely((flags & __GFP_ZERO) && ptr))
  		memset(ptr, 0, obj_size(cachep));
  
@@@ -3449,10 -3350,11 +3384,13 @@@ __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);
 +	kmemleak_alloc_recursive(objp, obj_size(cachep), 1, cachep->flags,
 +				 flags);
  	prefetchw(objp);
  
+ 	if (likely(objp))
+ 		kmemcheck_slab_alloc(cachep, flags, objp, obj_size(cachep));
+ 
  	if (unlikely((flags & __GFP_ZERO) && objp))
  		memset(objp, 0, obj_size(cachep));
  
@@@ -3566,9 -3468,10 +3504,11 @@@ static inline void __cache_free(struct 
  	struct array_cache *ac = cpu_cache_get(cachep);
  
  	check_irq_off();
 +	kmemleak_free_recursive(objp, cachep->flags);
  	objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
  
+ 	kmemcheck_slab_free(cachep, objp, obj_size(cachep));
+ 
  	/*
  	 * Skip calling cache_free_alien() when the platform is not numa.
  	 * This will avoid cache misses that happen while accessing slabp (which

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

* linux-next: manual merge of the kmemcheck tree with the kmemleak tree
@ 2009-06-01  7:55 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-01  7:55 UTC (permalink / raw)
  To: Vegard Nossum, Pekka Enberg, Ingo Molnar
  Cc: linux-next, linux-kernel, Catalin Marinas

Hi all,

Today's linux-next merge of the kmemcheck tree got a conflict in
mm/slub.c between commit 5247520db9023300947e5b77943bc0719f33d4b9
("kmemleak: Add the slub memory allocation/freeing hooks") from the
kmemleak tree and commit 18fd427debcf37c06917b55295df682fd05fee76 ("slub:
add hooks for kmemcheck") from the kmemcheck tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc mm/slub.c
index 6674a79,4ac5e3e..0000000
--- a/mm/slub.c
+++ b/mm/slub.c
@@@ -144,10 -143,10 +145,10 @@@
   * Set of flags that will prevent slab merging
   */
  #define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
 -		SLAB_TRACE | SLAB_DESTROY_BY_RCU)
 +		SLAB_TRACE | SLAB_DESTROY_BY_RCU | SLAB_NOLEAKTRACE)
  
  #define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \
- 		SLAB_CACHE_DMA)
+ 		SLAB_CACHE_DMA | SLAB_NOTRACK)
  
  #ifndef ARCH_KMALLOC_MINALIGN
  #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
@@@ -1618,7 -1637,7 +1641,8 @@@ static __always_inline void *slab_alloc
  	if (unlikely((gfpflags & __GFP_ZERO) && object))
  		memset(object, 0, objsize);
  
 +	kmemleak_alloc_recursive(object, objsize, 1, s->flags, gfpflags);
+ 	kmemcheck_slab_alloc(s, gfpflags, object, c->objsize);
  	return object;
  }
  
@@@ -1748,9 -1767,9 +1772,10 @@@ static __always_inline void slab_free(s
  	struct kmem_cache_cpu *c;
  	unsigned long flags;
  
 +	kmemleak_free_recursive(x, s->flags);
  	local_irq_save(flags);
  	c = get_cpu_slab(s, smp_processor_id());
+ 	kmemcheck_slab_free(s, object, c->objsize);
  	debug_check_no_locks_freed(object, c->objsize);
  	if (!(s->flags & SLAB_DEBUG_OBJECTS))
  		debug_check_no_obj_freed(object, c->objsize);

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

end of thread, other threads:[~2009-06-01  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-01  7:55 linux-next: manual merge of the kmemcheck tree with the kmemleak tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2009-06-01  7:55 Stephen Rothwell
2009-06-01  7:55 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).