summaryrefslogtreecommitdiff
path: root/opendc/opendc-compute/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-03-16 22:37:06 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-03-16 22:37:06 +0100
commitdf088c89b43c4bcb5051c42906e91258ccd69ce5 (patch)
tree907481fe3e2d2d7935ee7b4b6ffe14ed1ca012cb /opendc/opendc-compute/src
parent7c2f254aacd17ee0e77a0b09a464baa8044b6c3a (diff)
parent1e95d668eb21eece59a402f500a9e38ec51af596 (diff)
Merge branch '2.x-perf-interf-extension' into '2.x'
Extend performance interference model to support minimum server load See merge request opendc/opendc-simulator!43
Diffstat (limited to 'opendc/opendc-compute/src')
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt
index 7cd48bc3..430e5a37 100644
--- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt
+++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt
@@ -145,6 +145,7 @@ class HypervisorVirtDriver(
val burst = LongArray(hostContext.cpus.size)
val totalUsage = maxUsage - availableUsage
availableUsage = totalUsage
+ val serverLoad = totalUsage / maxUsage
// Divide the requests over the available capacity of the pCPUs fairly
for (i in hostContext.cpus.indices.sortedBy { hostContext.cpus[it].frequency }) {
@@ -174,8 +175,9 @@ class HypervisorVirtDriver(
for (vm in vms) {
// Apply performance interference model
- val performanceModel = vm.server.image.tags[IMAGE_PERF_INTERFERENCE_MODEL] as? PerformanceInterferenceModel?
- val performanceScore = performanceModel?.apply(imagesRunning) ?: 1.0
+ val performanceModel =
+ vm.server.image.tags[IMAGE_PERF_INTERFERENCE_MODEL] as? PerformanceInterferenceModel?
+ val performanceScore = performanceModel?.apply(imagesRunning, serverLoad) ?: 1.0
for ((i, req) in vm.requests.withIndex()) {
// Compute the fraction of compute time allocated to the VM