examples/vm_power: fix OOB frequency oscillations
authorDavid Hunt <david.hunt@intel.com>
Wed, 24 Jul 2019 13:18:03 +0000 (14:18 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 12 Nov 2019 07:21:57 +0000 (08:21 +0100)
commit31c9a66465ad623258c4449fea54c0b42a2deae1
treee5c63ac8f2ae7706b844277dd36569d00dc807d7
parenteccc5d3237fc549ba647654a7f74f8b9e9dcaf6d
examples/vm_power: fix OOB frequency oscillations

The branch ratio algorithm in the vm_power_manager sample application
can be very sensitive at patricular loads in a workload, causing
oscillations between min and max frequency. For example, if a
workload is at 50%, scaling up may change the ratio
enough that it immediately thinks it needs to scale down again.

This patch introduces a sliding window recording the scale up/down
direction for the last 32 samples, and scales up if any samples indicate
we should scale up, otherwise scale down. Each core has it's own window.

Fixes: 4b1a631b8a8a ("examples/vm_power: add oob monitoring functions")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
examples/vm_power_manager/oob_monitor_x86.c
examples/vm_power_manager/power_manager.c
examples/vm_power_manager/power_manager.h