]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
slub: min order when debug_guardpage_minorder > 0
authorStanislaw Gruszka <sgruszka@redhat.com>
Fri, 16 Dec 2011 04:49:52 +0000 (15:49 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 19 Dec 2011 07:19:27 +0000 (18:19 +1100)
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 <sgruszka@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/slub.c

index 48a07287386f4187abe789a1b6ccaf3840611e18..6920ffcb62894e41b0788f36f40f2840391f7bb7 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3671,6 +3671,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 *);