aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv/channel_mgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hv/channel_mgmt.c')
-rw-r--r--drivers/hv/channel_mgmt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 30613dfa38b3..39c5afc7970c 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -392,6 +392,7 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
392 struct vmbus_channel *primary = channel->primary_channel; 392 struct vmbus_channel *primary = channel->primary_channel;
393 int next_node; 393 int next_node;
394 struct cpumask available_mask; 394 struct cpumask available_mask;
395 struct cpumask *alloced_mask;
395 396
396 for (i = IDE; i < MAX_PERF_CHN; i++) { 397 for (i = IDE; i < MAX_PERF_CHN; i++) {
397 if (!memcmp(type_guid->b, hp_devs[i].guid, 398 if (!memcmp(type_guid->b, hp_devs[i].guid,
@@ -409,7 +410,6 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
409 * channel, bind it to cpu 0. 410 * channel, bind it to cpu 0.
410 */ 411 */
411 channel->numa_node = 0; 412 channel->numa_node = 0;
412 cpumask_set_cpu(0, &channel->alloced_cpus_in_node);
413 channel->target_cpu = 0; 413 channel->target_cpu = 0;
414 channel->target_vp = hv_context.vp_index[0]; 414 channel->target_vp = hv_context.vp_index[0];
415 return; 415 return;
@@ -434,21 +434,22 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
434 channel->numa_node = next_node; 434 channel->numa_node = next_node;
435 primary = channel; 435 primary = channel;
436 } 436 }
437 alloced_mask = &hv_context.hv_numa_map[primary->numa_node];
437 438
438 if (cpumask_weight(&primary->alloced_cpus_in_node) == 439 if (cpumask_weight(alloced_mask) ==
439 cpumask_weight(cpumask_of_node(primary->numa_node))) { 440 cpumask_weight(cpumask_of_node(primary->numa_node))) {
440 /* 441 /*
441 * We have cycled through all the CPUs in the node; 442 * We have cycled through all the CPUs in the node;
442 * reset the alloced map. 443 * reset the alloced map.
443 */ 444 */
444 cpumask_clear(&primary->alloced_cpus_in_node); 445 cpumask_clear(alloced_mask);
445 } 446 }
446 447
447 cpumask_xor(&available_mask, &primary->alloced_cpus_in_node, 448 cpumask_xor(&available_mask, alloced_mask,
448 cpumask_of_node(primary->numa_node)); 449 cpumask_of_node(primary->numa_node));
449 450
450 cur_cpu = cpumask_next(-1, &available_mask); 451 cur_cpu = cpumask_next(-1, &available_mask);
451 cpumask_set_cpu(cur_cpu, &primary->alloced_cpus_in_node); 452 cpumask_set_cpu(cur_cpu, alloced_mask);
452 453
453 channel->target_cpu = cur_cpu; 454 channel->target_cpu = cur_cpu;
454 channel->target_vp = hv_context.vp_index[cur_cpu]; 455 channel->target_vp = hv_context.vp_index[cur_cpu];