diff options
author | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2004-05-20 17:43:17 +0000 |
---|---|---|
committer | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2004-05-20 17:43:17 +0000 |
commit | 6bf53ef08d47db840c3d18ed5eb0e1fcf1dda730 (patch) | |
tree | 04ad6fb3ae1bc8bcd7b48bba44f23223d3d76d2c /xen | |
parent | e1ec1b7f3dd3aa0c1907fbc96ff533fd469160fb (diff) | |
download | xen-6bf53ef08d47db840c3d18ed5eb0e1fcf1dda730.tar.gz xen-6bf53ef08d47db840c3d18ed5eb0e1fcf1dda730.tar.bz2 xen-6bf53ef08d47db840c3d18ed5eb0e1fcf1dda730.zip |
bitkeeper revision 1.911.1.5 (40acee35tmC494sW3OcQEIN4ymTS1w)
Nasty temporary mechanism that allows dom0 to block after issuing a stop on another domain.
Diffstat (limited to 'xen')
-rw-r--r-- | xen/common/dom0_ops.c | 14 | ||||
-rw-r--r-- | xen/common/domain.c | 10 | ||||
-rw-r--r-- | xen/common/schedule.c | 5 | ||||
-rw-r--r-- | xen/include/hypervisor-ifs/dom0_ops.h | 3 |
4 files changed, 31 insertions, 1 deletions
diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index 3b413a1faa..780e76e638 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -102,6 +102,20 @@ long do_dom0_op(dom0_op_t *u_dom0_op) case DOM0_STOPDOMAIN: { ret = stop_other_domain(op->u.stopdomain.domain); + + /* This is grim, but helps for live migrate. It's also unsafe + in the strict sense as we're not explicitly setting a + timeout, but dom0 is bound to have other timers going off to + wake us back up. + We go to sleep so that the other domain can stop quicker, hence + we have less total down time in a migrate. + */ + if( ret == 0 && op->u.stopdomain.sync == 1 ) + { + extern long do_block( void ); + printk("T\n"); + do_block(); // Yuk... + } } break; diff --git a/xen/common/domain.c b/xen/common/domain.c index ee11f20fcd..52becabf5c 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -266,6 +266,16 @@ void stop_domain(void) unlazy_fpu(current); wmb(); /* All CPUs must see saved info in state TASK_STOPPED. */ set_current_state(TASK_STOPPED); + + /* OK, this is grim, but helps speed up live migrate. When a domain stops, + kick Dom0 */ + { + struct task_struct *p; + printk("S\n"); + guest_schedule_to_run( p = find_domain_by_id(0ULL) ); + put_task_struct(p); + } + __enter_scheduler(); } diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 5aa12bf8cb..b5e4219d6c 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -27,6 +27,9 @@ #include <xen/perfc.h> #include <xen/sched-if.h> #include <hypervisor-ifs/sched_ctl.h> + +#undef TRACE_BUFFER + #include <xen/trace.h> /*#define WAKEUP_HISTO*/ @@ -216,7 +219,7 @@ void wake_up(struct task_struct *p) /* * Block the currently-executing domain until a pertinent event occurs. */ -static long do_block(void) +long do_block(void) { ASSERT(current->domain != IDLE_DOMAIN_ID); current->shared_info->vcpu_data[0].evtchn_upcall_mask = 0; diff --git a/xen/include/hypervisor-ifs/dom0_ops.h b/xen/include/hypervisor-ifs/dom0_ops.h index 58b1480525..2a17605bf2 100644 --- a/xen/include/hypervisor-ifs/dom0_ops.h +++ b/xen/include/hypervisor-ifs/dom0_ops.h @@ -74,6 +74,9 @@ typedef struct dom0_stopdomain_st { /* IN parameters. */ domid_t domain; + /* hack to indicate that you want to wait for other domain -- replace + with proper sychronous stop soon! */ + int sync; } dom0_stopdomain_t; #define DOM0_GETDOMAININFO 12 |