Whamcloud - gitweb
LU-6261 gnilnd: Use kgnilnd_vzalloc to allocate fma blocks. 38/15438/4
authorChris Horn <hornc@cray.com>
Mon, 27 Jul 2015 20:03:42 +0000 (16:03 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 31 Jul 2015 01:33:06 +0000 (01:33 +0000)
In low memory situations we may not be able to allocate memory.
vmalloc tries forever to get memory.
Use kgnilnd_vzalloc which uses the GFP_NOFS flag for allocating
memory for fma blocks.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I18f8564424abfc9c63e675ac98ca61487b5a2b34
Reviewed-on: http://review.whamcloud.com/15438
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>

index 4ca4542..408ca65 100644 (file)
@@ -166,7 +166,7 @@ kgnilnd_alloc_fmablk(kgn_device_t *device, int use_phys)
                         num_mbox, fma_blk->gnm_blk_size, fma_blk->gnm_mbox_size,
-               LIBCFS_ALLOC(fma_blk->gnm_block, fma_blk->gnm_blk_size);
+               fma_blk->gnm_block = kgnilnd_vzalloc(fma_blk->gnm_blk_size);
                if (fma_blk->gnm_block == NULL) {
                        CNETERR("could not allocate virtual SMSG mailbox memory, %d bytes\n", fma_blk->gnm_blk_size);
                        rc = -ENOMEM;