From b5b79a12c41b5e76af9d47551027b56f210d9029 Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Wed, 17 Apr 2013 10:57:32 +0000 Subject: xen: allow for explicitly specifying node-affinity Make it possible to pass the node-affinity of a domain to the hypervisor from the upper layers, instead of always being computed automatically. Note that this also required generalizing the Flask hooks for setting and getting the affinity, so that they now deal with both vcpu and node affinity. Signed-off-by: Dario Faggioli Acked-by: Daniel De Graaf Acked-by: George Dunlap Acked-by: Juergen Gross Acked-by: Keir Fraser --- xen/include/xen/sched.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xen/include/xen/sched.h') diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index d15d567c9b..ad971d22fe 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -288,6 +288,8 @@ struct domain /* Does this guest need iommu mappings? */ bool_t need_iommu; #endif + /* is node-affinity automatically computed? */ + bool_t auto_node_affinity; /* Is this guest fully privileged (aka dom0)? */ bool_t is_privileged; /* Which guest this guest has privileges on */ @@ -365,7 +367,10 @@ struct domain /* Various mem_events */ struct mem_event_per_domain *mem_event; - /* Currently computed from union of all vcpu cpu-affinity masks. */ + /* + * Can be specified by the user. If that is not the case, it is + * computed from the union of all the vcpu cpu-affinity masks. + */ nodemask_t node_affinity; unsigned int last_alloc_node; spinlock_t node_affinity_lock; @@ -435,6 +440,7 @@ static inline void get_knownalive_domain(struct domain *d) ASSERT(!(atomic_read(&d->refcnt) & DOMAIN_DESTROYED)); } +int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity); void domain_update_node_affinity(struct domain *d); struct domain *domain_create( @@ -555,6 +561,7 @@ void sched_destroy_domain(struct domain *d); int sched_move_domain(struct domain *d, struct cpupool *c); long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *); long sched_adjust_global(struct xen_sysctl_scheduler_op *); +void sched_set_node_affinity(struct domain *, nodemask_t *); int sched_id(void); void sched_tick_suspend(void); void sched_tick_resume(void); -- cgit v1.2.3