Re: 2.6.21-rc5-mm4 (SLUB)

From: Christoph Lameter
Date: Wed Apr 04 2007 - 14:24:02 EST


On Wed, 4 Apr 2007, Christoph Lameter wrote:

> Yes. slub_debug=U. But user tracking may need to increase the slab
> size (depends on the padding available in the slab) to store the
> tracking information, so you may not get the same corruption.

Hummm U is switching off merging and you may need merging to trigger the
discovery of the overwrite.

Here is a patch to enable merging even while tracking slabs. This patch
should not be applied to mm. In general tracking requires knowing which
slab the objects come from and merging looses that information.

Index: linux-2.6.21-rc5-mm4/mm/slub.c
===================================================================
--- linux-2.6.21-rc5-mm4.orig/mm/slub.c 2007-04-04 11:19:29.000000000 -0700
+++ linux-2.6.21-rc5-mm4/mm/slub.c 2007-04-04 11:19:35.000000000 -0700
@@ -86,7 +86,7 @@
/*
* Set of flags that will prevent slab merging
*/
-#define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
+#define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | \
SLAB_TRACE | SLAB_DESTROY_BY_RCU)

#define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/