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_sedf.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_sedf.c')
-rw-r--r-- | xen/common/sched_sedf.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c index 9a3e7c54f1..e2722ea3c2 100644 --- a/xen/common/sched_sedf.c +++ b/xen/common/sched_sedf.c @@ -790,7 +790,13 @@ static struct task_slice sedf_do_schedule(s_time_t now) /*now simply pick the first domain from the runqueue, which has the earliest deadline, because the list is sorted*/ - if ( !list_empty(runq) ) + /* Tasklet work (which runs in idle VCPU context) overrides all else. */ + if ( !tasklet_queue_empty(cpu) || (list_empty(runq) && list_empty(waitq)) ) + { + ret.task = IDLETASK(cpu); + ret.time = SECONDS(1); + } + else if ( !list_empty(runq) ) { runinf = list_entry(runq->next,struct sedf_vcpu_info,list); ret.task = runinf->vcpu; @@ -808,29 +814,16 @@ static struct task_slice sedf_do_schedule(s_time_t now) { ret.time = runinf->slice - runinf->cputime; } - CHECK(ret.time > 0); - goto sched_done; } - - if ( !list_empty(waitq) ) + else { waitinf = list_entry(waitq->next,struct sedf_vcpu_info, list); /*we could not find any suitable domain => look for domains that are aware of extratime*/ ret = sedf_do_extra_schedule(now, PERIOD_BEGIN(waitinf), extraq, cpu); - CHECK(ret.time > 0); - } - else - { - /*this could probably never happen, but one never knows...*/ - /*it can... imagine a second CPU, which is pure scifi ATM, - but one never knows ;)*/ - ret.task = IDLETASK(cpu); - ret.time = SECONDS(1); } - sched_done: /*TODO: Do something USEFUL when this happens and find out, why it still can happen!!!*/ if ( ret.time < 0) |