aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_sedf.c
diff options
context:
space:
mode:
authorEmmanuel Ackaouy <ack@xensource.com>2006-11-06 17:32:00 +0000
committerEmmanuel Ackaouy <ack@xensource.com>2006-11-06 17:32:00 +0000
commit72ee01f5db3d6cf3eccabe72106ffa9e2c294e0f (patch)
tree31cb4eea8aa3a637c2cc2d00cb51aab0ec1a867b /xen/common/sched_sedf.c
parent32ae1c338735a03ae565404561332dde803af915 (diff)
downloadxen-72ee01f5db3d6cf3eccabe72106ffa9e2c294e0f.tar.gz
xen-72ee01f5db3d6cf3eccabe72106ffa9e2c294e0f.tar.bz2
xen-72ee01f5db3d6cf3eccabe72106ffa9e2c294e0f.zip
[XEN] Initial support for multi-core and multi-threaded CPU scheduling.
In multi-core and multi-threaded systems, not all idling "CPUs" are equal: When there are idling execution vehicles, it's better to spread VCPUs across sockets and cores before co-scheduling cores and threads. Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
Diffstat (limited to 'xen/common/sched_sedf.c')
-rw-r--r--xen/common/sched_sedf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 5b0029575f..5381fcb3ca 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -411,6 +411,14 @@ static void sedf_destroy_domain(struct domain *d)
xfree(d->sched_priv);
}
+static int sedf_pick_cpu(struct vcpu *v)
+{
+ cpumask_t online_affinity;
+
+ cpus_and(online_affinity, v->cpu_affinity, cpu_online_map);
+ return first_cpu(online_affinity);
+}
+
/*
* Handles the rescheduling & bookkeeping of domains running in their
* guaranteed timeslice.
@@ -1436,6 +1444,7 @@ struct scheduler sched_sedf_def = {
.destroy_vcpu = sedf_destroy_vcpu,
.do_schedule = sedf_do_schedule,
+ .pick_cpu = sedf_pick_cpu,
.dump_cpu_state = sedf_dump_cpu_state,
.sleep = sedf_sleep,
.wake = sedf_wake,