Skip to content

Commit 458d090

Browse files
andrea-parriliuw
authored andcommitted
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: Andrea Parri (Microsoft) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Michael Kelley <[email protected]> Signed-off-by: Wei Liu <[email protected]>
1 parent 5bf7468 commit 458d090

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

drivers/hv/channel_mgmt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ static void init_vp_index(struct vmbus_channel *channel)
702702
* In case alloc_cpumask_var() fails, bind it to
703703
* VMBUS_CONNECT_CPU.
704704
*/
705-
channel->numa_node = cpu_to_node(VMBUS_CONNECT_CPU);
706705
channel->target_cpu = VMBUS_CONNECT_CPU;
707706
if (perf_chn)
708707
hv_set_alloced_cpu(VMBUS_CONNECT_CPU);
@@ -719,7 +718,6 @@ static void init_vp_index(struct vmbus_channel *channel)
719718
continue;
720719
break;
721720
}
722-
channel->numa_node = numa_node;
723721
alloced_mask = &hv_context.hv_numa_map[numa_node];
724722

725723
if (cpumask_weight(alloced_mask) ==

drivers/hv/vmbus_drv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static ssize_t numa_node_show(struct device *dev,
226226
if (!hv_dev->channel)
227227
return -ENODEV;
228228

229-
return sprintf(buf, "%d\n", hv_dev->channel->numa_node);
229+
return sprintf(buf, "%d\n", cpu_to_node(hv_dev->channel->target_cpu));
230230
}
231231
static DEVICE_ATTR_RO(numa_node);
232232
#endif
@@ -1778,7 +1778,6 @@ static ssize_t target_cpu_store(struct vmbus_channel *channel,
17781778
*/
17791779

17801780
channel->target_cpu = target_cpu;
1781-
channel->numa_node = cpu_to_node(target_cpu);
17821781

17831782
/* See init_vp_index(). */
17841783
if (hv_is_perf_channel(channel))

include/linux/hyperv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,6 @@ struct vmbus_channel {
812812
* the earlier behavior.
813813
*/
814814
u32 target_cpu;
815-
int numa_node;
816815
/*
817816
* Support for sub-channels. For high performance devices,
818817
* it will be useful to have multiple sub-channels to support

0 commit comments

Comments
 (0)