xen: credit2: use curr_on_cpu(cpu) in place of `per_cpu(s, c).curr'
PATCH 1/1 xen: credit2: use curr_on_cpu(cpu) in place of `per_cpu(s, c).curr'
as 0bba5747f4bee4ddd ("xen: sched_credit: define and use curr_on_cpu(cpu)") did for Credit1, hence making the code more consistent and easier to read.
Signed-off-by Dario Faggioli <[email protected]>
Cc George Dunlap <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Keir Fraser <[email protected]>
--- xen/common/sched_credit2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
xen/common/sched_credit2.c +6 -6
@@ -493,7 +493,7 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu *BUG_ON (new->rqd != rqd);/* Look at the cpu it's running on first */ - cur =CSCHED2_VCPU (per_cpu (schedule_data, cpu).curr); + cur =CSCHED2_VCPU (curr_on_cpu (cpu));burn_credits (rqd, cur, now);if ( cur->credit < new->credit )
@@ -526,7 +526,7 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu *if ( i == cpu )continue ; - cur =CSCHED2_VCPU (per_cpu (schedule_data, i).curr); + cur =CSCHED2_VCPU (curr_on_cpu (i));BUG_ON (is_idle_vcpu (cur->vcpu));
@@ -658,7 +658,7 @@ void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_vcpu *svc, ss_time_t delta;/* Assert svc is current */ -ASSERT (svc==CSCHED2_VCPU (per_cpu (schedule_data, svc->vcpu->processor).curr)); +ASSERT (svc==CSCHED2_VCPU (curr_on_cpu (svc->vcpu->processor)));if (is_idle_vcpu (svc->vcpu) ) {
@@ -932,7 +932,7 @@ csched2_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)BUG_ON (is_idle_vcpu (vc) ); -if (per_cpu (schedule_data, vc->processor).curr == vc ) +if (curr_on_cpu (vc->processor) == vc )cpu_raise_softirq (vc->processor,SCHEDULE_SOFTIRQ );else if (__vcpu_on_runq (svc) ) {
@@ -957,7 +957,7 @@ csched2_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, vc->processor).curr == vc) ) +if (unlikely (curr_on_cpu (vc->processor) == vc) ) { goto out; }
@@ -1815,7 +1815,7 @@ csched2_dump_pcpu(const struct scheduler *ops, int cpu)printk ("core=%s\n" , cpustr);/* current VCPU */ - svc =CSCHED2_VCPU (per_cpu (schedule_data, cpu).curr); + svc =CSCHED2_VCPU (curr_on_cpu (cpu));if ( svc ) {printk ("\trun: " );
Quoted 5 lines · Dario Faggioli
as
0bba5747f4bee4ddd("xen:sched_credit: define and usecurr_on_cpu(cpu)") did for Credit1, hence making the code more consistent and easier to read.Signed-off-by Dario Faggioli <[email protected]>
Reviewed-by George Dunlap <[email protected]>