[PATCH v3 3/3] slub: min order when debug_guardpage_minorder > 0

From: Stanislaw Gruszka
Date: Fri Nov 18 2011 - 11:23:15 EST


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.

v1 -> v2:
- use slub_max_order to minimalize slub order

Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx>
---
mm/slub.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 7d2a996..a66be56 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3645,6 +3645,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 *);

--
1.7.1

--
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/