Commit 458d090f authored by Andrea Parri (Microsoft)'s avatar Andrea Parri (Microsoft) Committed by Wei Liu

Drivers: hv: vmbus: Remove the numa_node field from the vmbus_channel struct

The field is read only in numa_node_show() and it is already stored twice
(after a call to cpu_to_node()) in target_cpu_store() and init_vp_index();
there is no need to "cache" its value in the channel data structure.
Signed-off-by: default avatarAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20200617164642.37393-3-parri.andrea@gmail.comReviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
parent 5bf74682
...@@ -702,7 +702,6 @@ static void init_vp_index(struct vmbus_channel *channel) ...@@ -702,7 +702,6 @@ static void init_vp_index(struct vmbus_channel *channel)
* In case alloc_cpumask_var() fails, bind it to * In case alloc_cpumask_var() fails, bind it to
* VMBUS_CONNECT_CPU. * VMBUS_CONNECT_CPU.
*/ */
channel->numa_node = cpu_to_node(VMBUS_CONNECT_CPU);
channel->target_cpu = VMBUS_CONNECT_CPU; channel->target_cpu = VMBUS_CONNECT_CPU;
if (perf_chn) if (perf_chn)
hv_set_alloced_cpu(VMBUS_CONNECT_CPU); hv_set_alloced_cpu(VMBUS_CONNECT_CPU);
...@@ -719,7 +718,6 @@ static void init_vp_index(struct vmbus_channel *channel) ...@@ -719,7 +718,6 @@ static void init_vp_index(struct vmbus_channel *channel)
continue; continue;
break; break;
} }
channel->numa_node = numa_node;
alloced_mask = &hv_context.hv_numa_map[numa_node]; alloced_mask = &hv_context.hv_numa_map[numa_node];
if (cpumask_weight(alloced_mask) == if (cpumask_weight(alloced_mask) ==
......
...@@ -226,7 +226,7 @@ static ssize_t numa_node_show(struct device *dev, ...@@ -226,7 +226,7 @@ static ssize_t numa_node_show(struct device *dev,
if (!hv_dev->channel) if (!hv_dev->channel)
return -ENODEV; return -ENODEV;
return sprintf(buf, "%d\n", hv_dev->channel->numa_node); return sprintf(buf, "%d\n", cpu_to_node(hv_dev->channel->target_cpu));
} }
static DEVICE_ATTR_RO(numa_node); static DEVICE_ATTR_RO(numa_node);
#endif #endif
...@@ -1778,7 +1778,6 @@ static ssize_t target_cpu_store(struct vmbus_channel *channel, ...@@ -1778,7 +1778,6 @@ static ssize_t target_cpu_store(struct vmbus_channel *channel,
*/ */
channel->target_cpu = target_cpu; channel->target_cpu = target_cpu;
channel->numa_node = cpu_to_node(target_cpu);
/* See init_vp_index(). */ /* See init_vp_index(). */
if (hv_is_perf_channel(channel)) if (hv_is_perf_channel(channel))
......
...@@ -812,7 +812,6 @@ struct vmbus_channel { ...@@ -812,7 +812,6 @@ struct vmbus_channel {
* the earlier behavior. * the earlier behavior.
*/ */
u32 target_cpu; u32 target_cpu;
int numa_node;
/* /*
* Support for sub-channels. For high performance devices, * Support for sub-channels. For high performance devices,
* it will be useful to have multiple sub-channels to support * it will be useful to have multiple sub-channels to support
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment