summaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-15 16:11:17 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-15 16:11:17 -0400
commit6684e323a236d40461f27d36b38c6b70aabc9e71 (patch)
tree7eb6e0a22b7083c5e08f4f2cf3f15be7d938a572 /include/linux/slub_def.h
parent7531d692d4174789d583eb50fcb83cefa121b790 (diff)
parent0560551dca0c02a4b23f95a9c339882ff291e1c7 (diff)
downloadlinux-6684e323a236d40461f27d36b38c6b70aabc9e71.tar.gz
linux-6684e323a236d40461f27d36b38c6b70aabc9e71.tar.bz2
linux-6684e323a236d40461f27d36b38c6b70aabc9e71.zip
Merge branch 'origin'
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r--include/linux/slub_def.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index ea27065e80e6..fd6627e2d115 100644
--- a/include/linux/slub_def.h
+++ b/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)