From haizea-commit at mailman.cs.uchicago.edu Wed Dec 8 11:36:27 2010 From: haizea-commit at mailman.cs.uchicago.edu (haizea-commit at mailman.cs.uchicago.edu) Date: Wed, 8 Dec 2010 11:36:27 -0600 Subject: [haizea-commit] r849 - branches/1.1/src/haizea/core/scheduler Message-ID: <20101208173628.249C8B06D1@mallorn.cs.uchicago.edu> Author: borja Date: 2010-12-08 11:36:27 -0600 (Wed, 08 Dec 2010) New Revision: 849 Modified: branches/1.1/src/haizea/core/scheduler/vm_scheduler.py Log: If we're not using suspension, set the scheduling threshold to 0. Modified: branches/1.1/src/haizea/core/scheduler/vm_scheduler.py =================================================================== --- branches/1.1/src/haizea/core/scheduler/vm_scheduler.py 2010-11-29 16:29:39 UTC (rev 848) +++ branches/1.1/src/haizea/core/scheduler/vm_scheduler.py 2010-12-08 17:36:27 UTC (rev 849) @@ -1281,7 +1281,8 @@ if threshold != None: # If there is a hard-coded threshold, use that return threshold - else: + + if config.get("suspension") != constants.SUSPENSION_NONE: factor = config.get("scheduling-threshold-factor") # First, figure out the "safe duration" (the minimum duration @@ -1293,21 +1294,23 @@ if lease.get_state() == Lease.STATE_SUSPENDED_QUEUED: resm_overhead = lease.estimate_resume_time() safe_duration += resm_overhead + else: + safe_duration = 0 - # TODO: Incorporate other overheads into the minimum duration - min_duration = safe_duration - - # At the very least, we want to allocate enough time for the - # safe duration (otherwise, we'll end up with incorrect schedules, - # where a lease is scheduled to suspend, but isn't even allocated - # enough time to suspend). - # The factor is assumed to be non-negative. i.e., a factor of 0 - # means we only allocate enough time for potential suspend/resume - # operations, while a factor of 1 means the lease will get as much - # running time as spend on the runtime overheads involved in setting - # it up - threshold = safe_duration + (min_duration * factor) - return threshold + # TODO: Incorporate other overheads into the minimum duration + min_duration = safe_duration + + # At the very least, we want to allocate enough time for the + # safe duration (otherwise, we'll end up with incorrect schedules, + # where a lease is scheduled to suspend, but isn't even allocated + # enough time to suspend). + # The factor is assumed to be non-negative. i.e., a factor of 0 + # means we only allocate enough time for potential suspend/resume + # operations, while a factor of 1 means the lease will get as much + # running time as spend on the runtime overheads involved in setting + # it up + threshold = safe_duration + (min_duration * factor) + return threshold #-------------------------------------------------------------------#