From faf148a7c97df9d6eab9ec4dc676a73822c07867 Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Wed, 30 Nov 2011 15:11:30 +1100 Subject: [PATCH] slub: min order when debug_guardpage_minorder > 0 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 Cc: "Rafael J. Wysocki" Cc: Andrea Arcangeli Acked-by: Christoph Lameter Cc: Mel Gorman Cc: Stanislaw Gruszka Cc: Pekka Enberg Signed-off-by: Andrew Morton --- mm/slub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/slub.c b/mm/slub.c index 108ed03fb422..04e89e50a6dd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3657,6 +3657,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 *); -- 2.39.5