Change in vdsm[master]: vm: migration: move wait countdown in a function
automat...@ovirt.org has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 7: * Update tracker::IGNORE, no Bug-Url found -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
Francesco Romani has abandoned this change. Change subject: vm: migration: move wait countdown in a function .. Abandoned In the end, the benefits are doubtful. -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 7: Build Failed http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13412/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12622/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1932/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/188/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13574/ : FAILURE -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
Francesco Romani has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 5: (2 comments) http://gerrit.ovirt.org/#/c/32706/5//COMMIT_MSG Commit Message: Line 9: The Downtime thread is a migration helper thread Line 10: which is in charge of periodically updating the Line 11: migration downtime. Line 12: Line 13: This thread blindly does a configurabile number configurabile - configurable Done Line 14: of steps, and after each step it updates the Line 15: downtime according to a given law. Line 16: Line 17: Between each step, it waits for a number of http://gerrit.ovirt.org/#/c/32706/5/vdsm/virt/migration.py File vdsm/virt/migration.py: Line 361: for i in range(steps): Line 362: yield int(offset + base ** i) Line 363: Line 364: Line 365: def linear_wait(mem_size, delay, steps): for me, calling the second arg delay_per_gib would improve readabilty. delay_per_gib is a good improvement, will do. Not really sure about hiding the parameter. It makes the function nicer to be called, but IMO this parameter is as much important as the memory size, so either both stay or both go. Since I'm not sure how to make them both go, I'll keep them for now. Line 366: wait = (delay * max(mem_size, 2048) + 1023) / 1024 Line 367: Line 368: for _ in range(steps): Line 369: yield wait / steps -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 6: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13384/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13223/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12433/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1898/ : There was an infra issue, please contact in...@ovirt.org -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
Dan Kenigsberg has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 5: (2 comments) http://gerrit.ovirt.org/#/c/32706/5//COMMIT_MSG Commit Message: Line 9: The Downtime thread is a migration helper thread Line 10: which is in charge of periodically updating the Line 11: migration downtime. Line 12: Line 13: This thread blindly does a configurabile number configurabile - configurable Line 14: of steps, and after each step it updates the Line 15: downtime according to a given law. Line 16: Line 17: Between each step, it waits for a number of http://gerrit.ovirt.org/#/c/32706/5/vdsm/virt/migration.py File vdsm/virt/migration.py: Line 361: for i in range(steps): Line 362: yield int(offset + base ** i) Line 363: Line 364: Line 365: def linear_wait(mem_size, delay, steps): for me, calling the second arg delay_per_gib would improve readabilty. Alternatively, it can be hidden inside the function; I'm not sure of the merits of DELAY_PER_GIB. Line 366: wait = (delay * max(mem_size, 2048) + 1023) / 1024 Line 367: Line 368: for _ in range(steps): Line 369: yield wait / steps -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 5: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11758/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12702/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1706/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12547/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 4: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11534/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12478/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1670/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12323/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
Francesco Romani has uploaded a new change for review. Change subject: vm: migration: move wait countdown in a function .. vm: migration: move wait countdown in a function The Downtime thread is a migration helper thread which is in charge of periodically updating the migration downtime. This thread blindly does a configurabile number of steps, and after each step it updates the downtime according to a given law. Between each step, it waits for a number of seconds according to a different law. Both the cases on which migration ends while downtime thread is running and after it is ended are implicitely and gracefully handled by the existing code, since it is safe to set the downtime aynchronously. The downtime update law was already extracted; this patch also extracts the wait law, in order to improve readability and testability. Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Signed-off-by: Francesco Romani from...@redhat.com --- M vdsm/virt/migration.py 1 file changed, 15 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/32706/1 diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py index 836fe3c..97333ca 100644 --- a/vdsm/virt/migration.py +++ b/vdsm/virt/migration.py @@ -362,8 +362,17 @@ yield offset + int(base ** i) +def linear_wait(mem_size, delay, steps): +wait = (delay * max(mem_size, 2048) + 1023) / 1024 + +for _ in range(steps): +yield wait / steps + + class DowntimeThread(threading.Thread): DOWNTIME_STEPS = config.getint('vars', 'migration_downtime_steps') + +DELAY_PER_GIB = config.getint('vars', 'migration_downtime_delay') def __init__(self, vm, downtime): super(DowntimeThread, self).__init__() @@ -373,19 +382,18 @@ self._stop = threading.Event() -delay_per_gib = config.getint('vars', 'migration_downtime_delay') -mem_size = int(self._vm.conf['memSize']) -self._wait = (delay_per_gib * max(mem_size, 2048) + 1023) / 1024 - self.daemon = True self.start() def run(self): self._vm.log.debug('migration downtime thread started') -for downtime in exponential_downtime(self._downtime, - self.DOWNTIME_STEPS): -self._stop.wait(self._wait / self.DOWNTIME_STEPS) +for downtime, wait in zip(exponential_downtime(self._downtime, + self.DOWNTIME_STEPS), + linear_wait(int(self._vm.conf['memSize']), + self.DELAY_PER_GIB, + self.DOWNTIME_STEPS)): +self._stop.wait(wait) if self._stop.isSet(): break -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 1: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12361/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11417/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1642/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12205/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 2: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12364/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11420/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1644/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12209/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: migration: move wait countdown in a function
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: migration: move wait countdown in a function .. Patch Set 3: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12371/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11427/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1646/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12216/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32706 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id808539a654e1556519ed54f6f4b67364eacf48a Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches