From: Ansgar E. <an...@th...> - 2006-03-31 16:15:29
|
When asking an already migrated process to move to another (remote) node, bring it back home first. The current implementation leads to a crash. A direct remote->remote migration would be better, but is not implemented yet. --- hpc/migctrl.c | 84 +++++++++++++++++++++++++++++++----------------------= ---- 1 files changed, 46 insertions(+), 38 deletions(-) 2a7d618eb6d2ae0942349f16e7a46d13351d7dc2 diff --git a/hpc/migctrl.c b/hpc/migctrl.c index 18a798a..dee9adb 100644 --- a/hpc/migctrl.c +++ b/hpc/migctrl.c @@ -79,6 +79,44 @@ int task_remote_wait_expel(task_t *p) return task_remote_expel(p); } =20 + +/** + * task_local_bring - Receive task back in the deputy stub + * @p: deputy task to receive + * @reason: reason to send (if any) + **/ +static int task_local_bring(task_t *p, int reason) +{ + int error; + om_link_t *link; + + if (obtain_mm(p)) { + printk(KERN_ERR "unable to obtain mm\n"); + goto failed; + } + + /* send remote request */ + comm_send_req(p->om.contact, DEP_COMING_HOME); + + /* see if other part is with on this */ + if (mig_recv_hshake(p->om.contact)) + goto failed; +=09 + /* receive the process back */ + error =3D mig_do_receive(p); + if (error) + goto failed; + + task_clear_dflags(p, DDEPUTY); + link =3D task_set_comm(p, NULL); + comm_close(link); + + return 0; +failed: + OMBUG("failed\n"); + return -1; +} + /** * task_local_send - Send a local task to remote * @p: task to send @@ -90,6 +128,14 @@ static int task_local_send(task_t *p, st om_link_t *mlink; int error =3D 0; =20 + /* if this is a stub, bring it back first */ + if (p->om.contact) + { + error =3D task_local_bring(p, reason); + if (error) + goto failed; + } + sockaddr_setup_port(whereto, REMOTE_DAEMON_PORT); mlink =3D comm_setup_connect(whereto, 0); if (!mlink) { @@ -123,44 +169,6 @@ failed: } =20 =20 - -/** - * task_local_bring - Receive task back in the deputy stub - * @p: deputy task to receive - * @reason: reason to send (if any) - **/ -static int task_local_bring(task_t *p, int reason) -{ - int error; - om_link_t *link; - - if (obtain_mm(p)) { - printk(KERN_ERR "unable to obtain mm\n"); - goto failed; - } - - /* send remote request */ - comm_send_req(p->om.contact, DEP_COMING_HOME); - - /* see if other part is with on this */ - if (mig_recv_hshake(p->om.contact)) - goto failed; - - /* receive the process back */ - error =3D mig_do_receive(p); - if (error) - goto failed; - - task_clear_dflags(p, DDEPUTY); - link =3D task_set_comm(p, NULL); - comm_close(link); - - return 0; -failed: - OMBUG("failed\n"); - return -1; -} - /** * task_move_remote2remote - migrate a task from remote to remote * @p: task to send --=20 1.2.4 --=20 Ansgar Esztermann Researcher & Sysadmin http://www2.thphy.uni-duesseldorf.de/~ansgar |