summaryrefslogtreecommitdiffstats
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@exchange.microsoft.com>2016-09-02 08:58:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-02 11:22:51 -0400
commit509879bdb30b8e12bd0b3cb0bc8429f01478df4b (patch)
treea2e9e25f47bec693795bd9493bdcce91bd61e38f /include/linux/hyperv.h
parentbb08d431a914984dee278e0e0482a2e6d620a482 (diff)
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.h23
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 {
674 HV_SIGNAL_POLICY_EXPLICIT, 674 HV_SIGNAL_POLICY_EXPLICIT,
675}; 675};
676 676
677enum hv_numa_policy {
678 HV_BALANCED = 0,
679 HV_LOCALIZED,
680};
681
677enum vmbus_device_type { 682enum vmbus_device_type {
678 HV_IDE = 0, 683 HV_IDE = 0,
679 HV_SCSI, 684 HV_SCSI,
@@ -876,6 +881,18 @@ struct vmbus_channel {
876 */ 881 */
877 bool low_latency; 882 bool low_latency;
878 883
884 /*
885 * NUMA distribution policy:
886 * We support teo policies:
887 * 1) Balanced: Here all performance critical channels are
888 * distributed evenly amongst all the NUMA nodes.
889 * This policy will be the default policy.
890 * 2) Localized: All channels of a given instance of a
891 * performance critical service will be assigned CPUs
892 * within a selected NUMA node.
893 */
894 enum hv_numa_policy affinity_policy;
895
879}; 896};
880 897
881static inline void set_channel_lock_state(struct vmbus_channel *c, bool state) 898static 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,
895 c->signal_policy = policy; 912 c->signal_policy = policy;
896} 913}
897 914
915static inline void set_channel_affinity_state(struct vmbus_channel *c,
916 enum hv_numa_policy policy)
917{
918 c->affinity_policy = policy;
919}
920
898static inline void set_channel_read_state(struct vmbus_channel *c, bool state) 921static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
899{ 922{
900 c->batched_reading = state; 923 c->batched_reading = state;