summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/affinity.c
diff options
context:
space:
mode:
authorHarish Chegondi <harish.chegondi@intel.com>2016-12-08 04:34:19 +0100
committerDoug Ledford <dledford@redhat.com>2016-12-11 21:29:42 +0100
commit9d8145a604937780898c0e4bdb124a57988fc2ed (patch)
treed60b98fe47eedeb8bf830674fdbdcfe8d031bcd5 /drivers/infiniband/hw/hfi1/affinity.c
parentIB/hfi1,IB/qib: Use new send completion helper (diff)
downloadlinux-9d8145a604937780898c0e4bdb124a57988fc2ed.tar.xz
linux-9d8145a604937780898c0e4bdb124a57988fc2ed.zip
IB/hfi1: Avoid credit return allocation for cpu-less NUMA nodes
Do not allocate credit return base and DMA memory for NUMA nodes without CPUs. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/affinity.c')
-rw-r--r--drivers/infiniband/hw/hfi1/affinity.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c
index a26a9a0bfc41..4962b6ef1f34 100644
--- a/drivers/infiniband/hw/hfi1/affinity.c
+++ b/drivers/infiniband/hw/hfi1/affinity.c
@@ -125,6 +125,7 @@ int node_affinity_init(void)
cpumask_weight(topology_sibling_cpumask(
cpumask_first(&node_affinity.proc.mask)
));
+ node_affinity.num_possible_nodes = num_possible_nodes();
node_affinity.num_online_nodes = num_online_nodes();
node_affinity.num_online_cpus = num_online_cpus();
@@ -135,7 +136,7 @@ int node_affinity_init(void)
*/
init_real_cpu_mask();
- hfi1_per_node_cntr = kcalloc(num_possible_nodes(),
+ hfi1_per_node_cntr = kcalloc(node_affinity.num_possible_nodes,
sizeof(*hfi1_per_node_cntr), GFP_KERNEL);
if (!hfi1_per_node_cntr)
return -ENOMEM;