Commit adc2b4c6 authored by David Dai's avatar David Dai Committed by Chromeos LUCI
Browse files

CHROMIUM: BACKPORT: FROMLIST: cpufreq: add kvm-cpufreq driver



Introduce a virtualized cpufreq driver for guest kernels to improve
performance and power of workloads within VMs.

This driver does two main things:

1. Sends utilization of vCPUs as a hint to the host. The host uses the
hint to schedule the vCPU threads and decide physical CPU frequency.

2. If a VM does not support a virtualized FIE(like AMUs), it uses
hypercalls to update the guest's frequency scaling factor periodically
by querying the host CPU frequency. This enables accurate
Per-Entity Load Tracking for tasks running in the guest.

Note that because the host already employs a rate_limit_us, we set the
transition_delay_us of the cpufreq policy to a miniscule value(1)
to avoid any additional delays between when the runqueue's util change
and a frequency response on the host.

Co-developed-by: default avatarSaravana Kannan <saravanak@google.com>
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Signed-off-by: default avatarDavid Dai <davidai@google.com>
(am from https://patchwork.kernel.org/patch/13195012/)
(also found at https://lore.kernel.org/r/20230330224348.1006691-7-davidai@google.com

)

BUG=b:249685960
TEST=Build
UPSTREAM-TASK=b:256983979

Change-Id: I372da144f6289363247cb840cb5ac1e31cb7f950
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4236484


Reviewed-by: default avatarSuleiman Souhlal <suleiman@chromium.org>
parent 2161e041
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment