In some (mis-)configurations, NUMA nodes may not have any local RAM,
or the memory allocations are non-uniform between NUMA nodes.
In the unlikely case that a CPT-bound allocation fails, retry the
allocation without the CPT-binding. Having some remote memory usage
is better than an allocation failure.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib0ab84bef8ff10c43bafb48a8082b62fc544ca29
Reviewed-on: https://review.whamcloud.com/32848
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#define __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, flags) \
do { \
#define __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, flags) \
do { \
- (ptr) = (cptab) == NULL ? \
- kmalloc(size, (flags) | __GFP_ZERO) : \
- cfs_cpt_malloc(cptab, cpt, size, (flags) | __GFP_ZERO); \
- if (likely((ptr) != NULL)) \
- OBD_ALLOC_POST(ptr, size, "kmalloced"); \
+ if (cptab) \
+ ptr = cfs_cpt_malloc((cptab), (cpt), (size), \
+ (flags) | __GFP_ZERO | __GFP_NOWARN); \
+ if (!(cptab) || unlikely(!(ptr))) /* retry without CPT if failure */ \
+ ptr = kmalloc(size, (flags) | __GFP_ZERO); \
+ if (likely((ptr) != NULL)) \
+ OBD_ALLOC_POST((ptr), (size), "kmalloced"); \
} while (0)
#define OBD_ALLOC_GFP(ptr, size, gfp_mask) \
} while (0)
#define OBD_ALLOC_GFP(ptr, size, gfp_mask) \