aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-06-23 20:16:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-24 11:59:12 -0400
commitdebee0768ea1978c6efba03206a414685e4a9ed1 (patch)
tree76b257ca8ea66e596ffb0744fdb51f98dd044bed /include
parent71c42157904404a37f89fff3b2536c55115823a5 (diff)
slab allocators: MAX_ORDER one off fix
MAX_ORDER is the first order that is not possible. Use MAX_ORDER - 1 to calculate the larges possible object size in slab.h Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/slab.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a015236cc572..cebcd3833c76 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -82,8 +82,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
82 * to do various tricks to work around compiler limitations in order to 82 * to do various tricks to work around compiler limitations in order to
83 * ensure proper constant folding. 83 * ensure proper constant folding.
84 */ 84 */
85#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) <= 25 ? \ 85#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \
86 (MAX_ORDER + PAGE_SHIFT) : 25) 86 (MAX_ORDER + PAGE_SHIFT - 1) : 25)
87 87
88#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) 88#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH)
89#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 89#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)