Re: [PATCH 1/3] kmemcheck: prepare for SLAB hooks

Previous thread: [PATCH 5/5] ide/Kconfig: couple of fixes by Bartlomiej Zolnierkiewicz on Thursday, May 8, 2008 - 5:05 pm. (1 message)

Next thread: [PATCH 2/3] slab: move struct kmem_cache to headers by Pekka J Enberg on Thursday, May 8, 2008 - 5:03 pm. (1 message)
To: <mingo@...>
Cc: <clameter@...>, <akpm@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Thursday, May 8, 2008 - 5:02 pm

From: Pekka Enberg <penberg@cs.helsinki.fi>

Make mm/slub_kmemcheck.c more generic in preparation for adding kmemcheck hooks
to SLAB which does not use compound pages by default and has slightly different
way for keeping track of object size than SLUB.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
include/linux/slub_kmemcheck.h | 19 +++++++++++--------
mm/slub.c | 8 ++++----
mm/slub_kmemcheck.c | 23 ++++++++++-------------
3 files changed, 25 insertions(+), 25 deletions(-)

Index: kmemcheck/include/linux/slub_kmemcheck.h
===================================================================
--- kmemcheck.orig/include/linux/slub_kmemcheck.h 2008-05-08 23:50:38.000000000 +0300
+++ kmemcheck/include/linux/slub_kmemcheck.h 2008-05-08 23:50:45.000000000 +0300
@@ -3,28 +3,31 @@

#ifdef CONFIG_KMEMCHECK
void kmemcheck_alloc_shadow(struct kmem_cache *s, gfp_t flags, int node,
- struct page *page);
-void kmemcheck_free_shadow(struct kmem_cache *s, struct page *page);
-void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object);
-void kmemcheck_slab_free(struct kmem_cache *s, void *object);
+ struct page *page, int order);
+void kmemcheck_free_shadow(struct kmem_cache *s, struct page *page, int order);
+void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object,
+ size_t size);
+void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size);
#else
static inline void
kmemcheck_alloc_shadow(struct kmem_cache *s, gfp_t flags, int node,
- struct page *page)
+ struct page *page, int order)
{
}

static inline void
-kmemcheck_free_shadow(struct kmem_cache *s, struct page *page)
+kmemcheck_free_shadow(struct kmem_cache *s, struct page *page, int order)
{...

To: Pekka J Enberg <penberg@...>
Cc: <mingo@...>, <clameter@...>, <akpm@...>, <linux-kernel@...>
Date: Friday, May 9, 2008 - 2:07 pm

Hm, "'c' is used uninitialized in this function". I guess it should be
moved a bit downwards. Can you fix it?

Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--

To: <mingo@...>
Cc: <clameter@...>, <akpm@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Thursday, May 8, 2008 - 5:10 pm

And oh, the file ought to be renamed now; it's not SLUB specific at all anymore.
--

Previous thread: [PATCH 5/5] ide/Kconfig: couple of fixes by Bartlomiej Zolnierkiewicz on Thursday, May 8, 2008 - 5:05 pm. (1 message)

Next thread: [PATCH 2/3] slab: move struct kmem_cache to headers by Pekka J Enberg on Thursday, May 8, 2008 - 5:03 pm. (1 message)