From 25c147ef8c10f75003752417ab3007ee15469268 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 15 May 2007 01:42:06 -0700 Subject: [PATCH] --- yaml --- r: 56398 b: refs/heads/master c: cfbf07f2a80b618c42a42c20d83647ea8fcceca0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/slub_def.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 75743526f8dc..b59ac8e54359 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6a3ee3d5529c5e66aedf91401bfac65c61998639 +refs/heads/master: cfbf07f2a80b618c42a42c20d83647ea8fcceca0 diff --git a/trunk/include/linux/slub_def.h b/trunk/include/linux/slub_def.h index ea27065e80e6..fd6627e2d115 100644 --- a/trunk/include/linux/slub_def.h +++ b/trunk/include/linux/slub_def.h @@ -60,7 +60,8 @@ struct kmem_cache { #define KMALLOC_SHIFT_LOW 3 #ifdef CONFIG_LARGE_ALLOCS -#define KMALLOC_SHIFT_HIGH 25 +#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) =< 25 ? \ + (MAX_ORDER + PAGE_SHIFT - 1) : 25) #else #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256 #define KMALLOC_SHIFT_HIGH 20 @@ -87,6 +88,9 @@ static inline int kmalloc_index(int size) */ WARN_ON_ONCE(size == 0); + if (size >= (1 << KMALLOC_SHIFT_HIGH)) + return -1; + if (size > 64 && size <= 96) return 1; if (size > 128 && size <= 192)