diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-05-17 19:27:52 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-05-17 20:34:30 +0200 |
| commit | 3228ba5694876a3ac9c0712d2b9330be9eb2f05c (patch) | |
| tree | e005ec498dc76c7a3fb3287c902f1920a0d98ddb /opendc/opendc-compute/src | |
| parent | 4b070203ef835011bcf99521a4e3b0e15e27c905 (diff) | |
bug: Limit CPU usage to demand
Diffstat (limited to 'opendc/opendc-compute/src')
| -rw-r--r-- | opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt | 2 |
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 |
