From 29b2865db32d53f04b6b3066e137f27226b39c20 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sun, 12 Apr 2020 22:30:02 +0200 Subject: Uncap total requested burst --- .../kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt index d81b8825..1edba7ed 100644 --- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt +++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt @@ -331,9 +331,7 @@ class SimpleVirtDriver( eventFlow.emit( HypervisorEvent.SliceFinished( this@SimpleVirtDriver, - // Only consider the burst that we could allocate in the time-frame that we ran, not the entire - // requested burst, since we some requests may be run in multiple slices - min(totalRequestedBurst, totalAllocatedBurst), + totalRequestedBurst, min(totalRequestedBurst, totalGrantedBurst), // We can run more than requested due to timing totalOvercommissionedBurst, totalInterferedBurst, // Might be smaller than zero due to FP rounding errors, -- cgit v1.2.3 From 0b70599086ce8397fead00e2c69ed8922ecc84b7 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Sun, 12 Apr 2020 23:34:40 +0200 Subject: bug: Adjust requested burst for run duration --- .../com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt index 1edba7ed..730d49f5 100644 --- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt +++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt @@ -274,7 +274,8 @@ class SimpleVirtDriver( continue } - // The total burst that the VMs wanted to run in the time-frame that we ran. + // The total requested burst that the VMs wanted to run in the time-frame that we ran. + val totalRequestedSubBurst = min(totalRequestedBurst, ceil(totalRequestedUsage * duration).toLong()) val totalRemainder = burst.sum() val totalGrantedBurst = totalAllocatedBurst - totalRemainder @@ -331,8 +332,8 @@ class SimpleVirtDriver( eventFlow.emit( HypervisorEvent.SliceFinished( this@SimpleVirtDriver, - totalRequestedBurst, - min(totalRequestedBurst, totalGrantedBurst), // We can run more than requested due to timing + totalRequestedSubBurst, + min(totalRequestedSubBurst, totalGrantedBurst), // We can run more than requested due to timing totalOvercommissionedBurst, totalInterferedBurst, // Might be smaller than zero due to FP rounding errors, totalAllocatedUsage, -- cgit v1.2.3