aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit2.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-12-10 10:49:48 +0000
committerKeir Fraser <keir@xen.org>2010-12-10 10:49:48 +0000
commit9c95209b5b3529b2db26396d46ca1a50bed587cd (patch)
tree3f573ed998a38820f77cf06ec066d66e1314e3a7 /xen/common/sched_credit2.c
parented00ef765e7b90be8e1455f55741f8aa970990e0 (diff)
downloadxen-9c95209b5b3529b2db26396d46ca1a50bed587cd.tar.gz
xen-9c95209b5b3529b2db26396d46ca1a50bed587cd.tar.bz2
xen-9c95209b5b3529b2db26396d46ca1a50bed587cd.zip
credit2: Use vcpu processor explicitly
No functional changes. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/common/sched_credit2.c')
-rw-r--r--xen/common/sched_credit2.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 4a52a5b22c..2855da0616 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -676,7 +676,6 @@ static void
csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
- const unsigned int cpu = vc->processor;
s_time_t now = 0;
/* Schedule lock should be held at this point. */
@@ -686,7 +685,7 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
BUG_ON( is_idle_vcpu(vc) );
/* Make sure svc priority mod happens before runq check */
- if ( unlikely(per_cpu(schedule_data, cpu).curr == vc) )
+ if ( unlikely(per_cpu(schedule_data, vc->processor).curr == vc) )
{
goto out;
}
@@ -710,8 +709,8 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
now = NOW();
/* Put the VCPU on the runq */
- runq_insert(ops, cpu, svc);
- runq_tickle(ops, cpu, svc, now);
+ runq_insert(ops, vc->processor, svc);
+ runq_tickle(ops, vc->processor, svc, now);
out:
d2printk("w-\n");
@@ -722,6 +721,7 @@ static void
csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
+ s_time_t now = NOW();
vcpu_schedule_lock_irq(vc);
@@ -738,14 +738,11 @@ csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
*/
if ( test_bit(__CSFLAG_delayed_runq_add, &svc->flags) )
{
- const unsigned int cpu = vc->processor;
-
- clear_bit(__CSFLAG_delayed_runq_add, &svc->flags);
-
BUG_ON(__vcpu_on_runq(svc));
+ clear_bit(__CSFLAG_delayed_runq_add, &svc->flags);
- runq_insert(ops, cpu, svc);
- runq_tickle(ops, cpu, svc, NOW());
+ runq_insert(ops, vc->processor, svc);
+ runq_tickle(ops, vc->processor, svc, now);
}
vcpu_schedule_unlock_irq(vc);