diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-04-19 10:12:41 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-04-19 10:12:41 +0100 |
commit | 10d7e8ed969aeb190b3e651282e3ee12f5560820 (patch) | |
tree | 73dc2c8900bdfc3121f2d0948dd4c764584067f8 /xen/common/sched_credit.c | |
parent | 197965150c69bde1d38ead5e8c7eb7bfa211d498 (diff) | |
download | xen-10d7e8ed969aeb190b3e651282e3ee12f5560820.tar.gz xen-10d7e8ed969aeb190b3e651282e3ee12f5560820.tar.bz2 xen-10d7e8ed969aeb190b3e651282e3ee12f5560820.zip |
Implement tasklets as running in VCPU context (sepcifically, idle-VCPU context)
...rather than in softirq context. This is expected to avoid a lot of
subtle deadlocks relating to the fact that softirqs can interrupt a
scheduled vcpu.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/sched_credit.c')
-rw-r--r-- | xen/common/sched_credit.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index ce42165402..cc191e26dc 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1167,12 +1167,17 @@ csched_schedule(s_time_t now) CSCHED_STAT_CRANK(schedule); CSCHED_VCPU_CHECK(current); - /* Update credits */ if ( !is_idle_vcpu(scurr->vcpu) ) { + /* Update credits of a non-idle VCPU. */ burn_credits(scurr, now); scurr->start_time -= now; } + else + { + /* Re-instate a boosted idle VCPU as normal-idle. */ + scurr->pri = CSCHED_PRI_IDLE; + } /* * Select next runnable local VCPU (ie top of local runq) @@ -1184,6 +1189,13 @@ csched_schedule(s_time_t now) snext = __runq_elem(runq->next); + /* Tasklet work (which runs in idle VCPU context) overrides all else. */ + if ( !tasklet_queue_empty(cpu) ) + { + snext = CSCHED_VCPU(idle_vcpu[cpu]); + snext->pri = CSCHED_PRI_TS_BOOST; + } + /* * SMP Load balance: * |