From: Stanislaw Gruszka Date: Tue, 10 Jan 2012 23:07:32 +0000 (-0800) Subject: slub: min order when debug_guardpage_minorder > 0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc8d8620d39dbbaf412b1b9247d77d196d92adb9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Linus Torvalds --- diff --git a/mm/slub.c b/mm/slub.c index 025f6ac51569..d99acbf14e01 100644 --- 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 *);