From: Adrien Lebre Date: Fri, 28 Nov 2014 16:29:16 +0000 (+0100) Subject: merge msg_vm.c - adrien (please note that there is one line (destruction of the tx_pr... X-Git-Tag: v3_12~760^2~56 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/539916de848562683cf2e5425d5160c2a43f135a merge msg_vm.c - adrien (please note that there is one line (destruction of the tx_process) where I don't not remind whether it is usefull or not... this can lead to a crash unfortunately, I will fix it later) --- 539916de848562683cf2e5425d5160c2a43f135a diff --cc src/msg/msg_vm.c index 301b65c6c2,cf88b632d8..5591e08331 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@@ -1133,22 -852,21 +852,20 @@@ static int migration_tx_fun(int argc, c stage3: /* Stage3: stop the VM and copy the rest of states. */ XBT_DEBUG("mig-stage3: remaining_size %f", remaining_size); - simcall_vm_suspend(vm); - stop_dirty_page_tracking(vm); - - TRY{ - send_migration_data(ms->vm, ms->src_pm, ms->dst_pm, remaining_size, ms->mbox, 3, 0, mig_speed, xfer_cpu_overhead); - }CATCH_ANONYMOUS{ - //hostfailure (if you want to know whether this is the SRC or the DST please check directly in send_migration_data code) - // Stop the dirty page tracking an return (there is no memory space to release) - XBT_INFO ("Process tx migration catches an expection and thus return"); - simcall_vm_resume(vm); - return 0; - } - - // At that point the Migration is considered valid for the SRC node but remind that the DST side should relocate effectively the VM on the DST node. + simcall_vm_suspend(ms->vm); + stop_dirty_page_tracking(ms->vm); + + TRY { + send_migration_data(ms->vm, ms->src_pm, ms->dst_pm, remaining_size, ms->mbox, 3, 0, mig_speed, -1); + } CATCH_ANONYMOUS { + //hostfailure (if you want to know whether this is the SRC or the DST please check directly in send_migration_data code) + // Stop the dirty page tracking an return (there is no memory space to release) + simcall_vm_resume(ms->vm); + return 0; + } + // At that point the Migration is considered valid for the SRC node but remind that the DST side should relocate effectively the VM on the DST node. - - XBT_DEBUG("mig: tx_done"); + XBT_INFO("mig: tx_done"); return 0; } @@@ -1190,10 -907,9 +907,9 @@@ static int do_migration(msg_vm_t vm, ms { XBT_DEBUG("wait for reception of the final ACK (i.e. migration has been correctly performed"); msg_task_t task = NULL; - msg_error_t ret = MSG_TIMEOUT; - while (ret == MSG_TIMEOUT && MSG_host_is_on(dst_pm)) //Wait while you receive the message ok - // Active waiting, evaluation is performed every one second. - ret = MSG_task_receive_with_timeout(&task, ms->mbox_ctl, 1); + msg_error_t ret = MSG_TIMEOUT; + while (ret == MSG_TIMEOUT && MSG_host_is_on(dst_pm)) //Wait while you receive the message o - ret = MSG_task_receive_with_timeout(&task, ms->mbox_ctl, 10); ++ ret = MSG_task_receive_with_timeout(&task, ms->mbox_ctl, 3); xbt_free(ms->mbox_ctl); xbt_free(ms->mbox); @@@ -1203,16 -919,15 +919,16 @@@ if(ret == MSG_HOST_FAILURE){ // Note that since the communication failed, the owner did not change and the task should be destroyed on the other side. // Hence, just throw the execption - //XBT_INFO("SRC crashes, throw an exception (m-control)"); - return -1; - } + XBT_INFO("SRC crashes, throw an exception (m-control)"); - MSG_process_kill(tx_process); ++ MSG_process_kill(tx_process); // Adrien, I made a merge on Nov 28th 2014, I'm not sure whether this line is required or not + return -1; + } else if((ret == MSG_TRANSFER_FAILURE) || (ret == MSG_TIMEOUT)){ // MSG_TIMEOUT here means that MSG_host_is_avail() returned false. - //XBT_INFO("DST crashes, throw an exception (m-control)"); - return -2; + XBT_INFO("DST crashes, throw an exception (m-control)"); + return -2; } - + char *expected_task_name = get_mig_task_name(vm, src_pm, dst_pm, 4); xbt_assert(strcmp(task->name, expected_task_name) == 0); xbt_free(expected_task_name);