On Thu, 10 May 2007, David Miller wrote:
> Unfortunately, still no dice with LARGE_ALLOCS=y/SLUB=y on sparc64.
> It still tries to create the 16MB kmalloc cache even though MAX_ORDER
> is 11. :-)
>
> I think this is an off-by-one error, the kmalloc cache builder
> iterates to >= KMALLOC_SHIFT_HIGH but your min() on MAX_ORDER would
> only work if it iterated to > KMALLOC_SHIFT_HIGH.
Then subtract one?
---
include/linux/slub_def.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: slub/include/linux/slub_def.h
===================================================================
--- slub.orig/include/linux/slub_def.h 2007-05-10 15:19:39.000000000 -0700
+++ slub/include/linux/slub_def.h 2007-05-10 16:06:15.000000000 -0700
@@ -59,7 +59,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
@@ -86,6 +87,9 @@ static inline int kmalloc_index(int size
*/
WARN_ON_ONCE(size == 0);
+ if (size >= (1UL << KMALLOC_SHIFT_HIGH))
+ return -1;
+
if (size > 64 && size <= 96)
return 1;
if (size > 128 && size <= 192)
-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html