diff options
author | K. Y. Srinivasan <kys@exchange.microsoft.com> | 2016-09-02 05:58:23 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-02 17:22:51 +0200 |
commit | 509879bdb30b8e12bd0b3cb0bc8429f01478df4b (patch) | |
tree | a2e9e25f47bec693795bd9493bdcce91bd61e38f /include/linux/hyperv.h | |
parent | Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (diff) | |
download | wireguard-linux-509879bdb30b8e12bd0b3cb0bc8429f01478df4b.tar.xz wireguard-linux-509879bdb30b8e12bd0b3cb0bc8429f01478df4b.zip |
Drivers: hv: Introduce a policy for controlling channel affinity
Introduce a mechanism to control how channels will be affinitized. We will
support two policies:
1. HV_BALANCED: All performance critical channels will be dstributed
evenly amongst all the available NUMA nodes. Once the Node is assigned,
we will assign the CPU based on a simple round robin scheme.
2. HV_LOCALIZED: Only the primary channels are distributed across all
NUMA nodes. Sub-channels will be in the same NUMA node as the primary
channel. This is the current behaviour.
The default policy will be the HV_BALANCED as it can minimize the remote
memory access on NUMA machines with applications that span NUMA nodes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r-- | include/linux/hyperv.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index e6ef571e6100..c877e7980585 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -674,6 +674,11 @@ enum hv_signal_policy { HV_SIGNAL_POLICY_EXPLICIT, }; +enum hv_numa_policy { + HV_BALANCED = 0, + HV_LOCALIZED, +}; + enum vmbus_device_type { HV_IDE = 0, HV_SCSI, @@ -876,6 +881,18 @@ struct vmbus_channel { */ bool low_latency; + /* + * NUMA distribution policy: + * We support teo policies: + * 1) Balanced: Here all performance critical channels are + * distributed evenly amongst all the NUMA nodes. + * This policy will be the default policy. + * 2) Localized: All channels of a given instance of a + * performance critical service will be assigned CPUs + * within a selected NUMA node. + */ + enum hv_numa_policy affinity_policy; + }; static inline void set_channel_lock_state(struct vmbus_channel *c, bool state) @@ -895,6 +912,12 @@ static inline void set_channel_signal_state(struct vmbus_channel *c, c->signal_policy = policy; } +static inline void set_channel_affinity_state(struct vmbus_channel *c, + enum hv_numa_policy policy) +{ + c->affinity_policy = policy; +} + static inline void set_channel_read_state(struct vmbus_channel *c, bool state) { c->batched_reading = state; |