slub: min order when debug_guardpage_minorder > 0
authorStanislaw Gruszka <[email protected]>
Tue, 10 Jan 2012 23:07:32 +0000 (15:07 -0800)
committerLinus Torvalds <[email protected]>
Wed, 11 Jan 2012 00:30:43 +0000 (16:30 -0800)
Disable slub debug facilities and allocate slabs at minimal order when
debug_guardpage_minorder > 0 to increase probability to catch random
memory corruption by cpu exception.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Stanislaw Gruszka <[email protected]>
Cc: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/slub.c

index 025f6ac515697354f171140cec6dfaed6eb4a7cb..d99acbf14e0179c766332b5f54f4f946b37a5d0f 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3654,6 +3654,9 @@ void __init kmem_cache_init(void)
        struct kmem_cache *temp_kmem_cache_node;
        unsigned long kmalloc_size;
 
+       if (debug_guardpage_minorder())
+               slub_max_order = 0;
+
        kmem_size = offsetof(struct kmem_cache, node) +
                                nr_node_ids * sizeof(struct kmem_cache_node *);