diff options
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r-- | include/linux/slub_def.h | 6 |
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 { | |||
60 | #define KMALLOC_SHIFT_LOW 3 | 60 | #define KMALLOC_SHIFT_LOW 3 |
61 | 61 | ||
62 | #ifdef CONFIG_LARGE_ALLOCS | 62 | #ifdef CONFIG_LARGE_ALLOCS |
63 | #define KMALLOC_SHIFT_HIGH 25 | 63 | #define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) =< 25 ? \ |
64 | (MAX_ORDER + PAGE_SHIFT - 1) : 25) | ||
64 | #else | 65 | #else |
65 | #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256 | 66 | #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256 |
66 | #define KMALLOC_SHIFT_HIGH 20 | 67 | #define KMALLOC_SHIFT_HIGH 20 |
@@ -87,6 +88,9 @@ static inline int kmalloc_index(int size) | |||
87 | */ | 88 | */ |
88 | WARN_ON_ONCE(size == 0); | 89 | WARN_ON_ONCE(size == 0); |
89 | 90 | ||
91 | if (size >= (1 << KMALLOC_SHIFT_HIGH)) | ||
92 | return -1; | ||
93 | |||
90 | if (size > 64 && size <= 96) | 94 | if (size > 64 && size <= 96) |
91 | return 1; | 95 | return 1; |
92 | if (size > 128 && size <= 192) | 96 | if (size > 128 && size <= 192) |