Whamcloud - gitweb
LU-10185 gnilnd: Use consistent size for GNI MBOX. 95/29895/4
authorRussell Cattelan <rcattelan@cray.com>
Thu, 15 Jun 2017 19:57:02 +0000 (14:57 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 22 Dec 2017 07:04:11 +0000 (07:04 +0000)
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>
lnet/klnds/gnilnd/gnilnd.c
lnet/klnds/gnilnd/gnilnd.h
lnet/klnds/gnilnd/gnilnd_conn.c

index 4976a07..4b79eeb 100644 (file)
@@ -2336,7 +2336,7 @@ int kgnilnd_base_startup(void)
        }
 
        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");
index b0d0f89..9ab8056 100644 (file)
 #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) */
index a281130..aa48010 100644 (file)
@@ -161,7 +161,7 @@ kgnilnd_alloc_fmablk(kgn_device_t *device, int use_phys)
                        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,