summaryrefslogtreecommitdiff
path: root/opendc/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-05-17 19:27:52 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-05-17 20:34:30 +0200
commit3228ba5694876a3ac9c0712d2b9330be9eb2f05c (patch)
treee005ec498dc76c7a3fb3287c902f1920a0d98ddb /opendc/opendc-compute
parent4b070203ef835011bcf99521a4e3b0e15e27c905 (diff)
bug: Limit CPU usage to demand
Diffstat (limited to 'opendc/opendc-compute')
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt2
1 files changed, 1 insertions, 1 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 53fa463b..ce814dd8 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
@@ -339,7 +339,7 @@ class SimpleVirtDriver(
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,
+ min(totalAllocatedUsage, totalRequestedUsage), // The allocated usage might be slightly higher due to FP rounding
totalRequestedUsage,
vmCount, // Some VMs might already have finished, so keep initial VM count
server