KMALLOC_MAX_SIZE is not consistent when changing
the allocator. For example when using the SLUB allocator
the size is set to 30 bits. For slab allocator the max size
is 25 bits or 32MB.
For SLAB this is a no-op change for other allocators the size
is also set to 32MB.
Test-parameters: trivial
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Icab4c69f9afd276d55360a76991ba9783f83ac8b
Reviewed-on: https://review.whamcloud.com/29895
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
}
kgnilnd_data.kgn_mbox_cache =
- kmem_cache_create("kgn_mbox_block", KMALLOC_MAX_SIZE, 0,
+ kmem_cache_create("kgn_mbox_block", GNILND_MBOX_SIZE, 0,
SLAB_HWCACHE_ALIGN, NULL);
if (kgnilnd_data.kgn_mbox_cache == NULL) {
CERROR("Can't create slab for physical mbox blocks\n");
#include <gni_pub.h>
#include "gnilnd_version.h"
+#ifdef CONFIG_SLAB
+#define GNILND_MBOX_SIZE KMALLOC_MAX_SIZE
+#else
+#define GNILND_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \
+ (MAX_ORDER + PAGE_SHIFT - 1) : 25)
+#define GNILND_SHIFT_MAX GNILND_SHIFT_HIGH
+#define GNILND_MBOX_SIZE (1UL << GNILND_SHIFT_MAX)
+#endif
+
/* tunables determined at compile time */
#define GNILND_MIN_TIMEOUT 5 /* minimum timeout interval (seconds) */
rc = -ENOMEM;
GOTO(free_desc, rc);
}
- fma_blk->gnm_blk_size = KMALLOC_MAX_SIZE;
+ fma_blk->gnm_blk_size = GNILND_MBOX_SIZE;
num_mbox = fma_blk->gnm_blk_size / fma_blk->gnm_mbox_size;
LASSERTF(num_mbox >= 1,