WSL2-Linux-Kernel/include
Daniel Lezcano 0e8f68d7f0 powercap/drivers/dtpm: Add CPU energy model based support
With the powercap dtpm controller, we are able to plug devices with
power limitation features in the tree.

The following patch introduces the CPU power limitation based on the
energy model and the performance states.

The power limitation is done at the performance domain level. If some
CPUs are unplugged, the corresponding power will be subtracted from
the performance domain total power.

It is up to the platform to initialize the dtpm tree and add the CPU.

Here is an example to create a simple tree with one root node called
"pkg" and the CPU's performance domains.

static int dtpm_register_pkg(struct dtpm_descr *descr)
{
	struct dtpm *pkg;
	int ret;

	pkg = dtpm_alloc(NULL);
	if (!pkg)
		return -ENOMEM;

	ret = dtpm_register(descr->name, pkg, descr->parent);
	if (ret)
		return ret;

	return dtpm_register_cpu(pkg);
}

static struct dtpm_descr descr = {
	.name = "pkg",
	.init = dtpm_register_pkg,
};
DTPM_DECLARE(descr);

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-12-22 19:50:40 +01:00
..
acpi
asm-generic powercap/drivers/dtpm: Add API for dynamic thermal power management 2020-12-22 19:50:40 +01:00
clocksource
crypto
drm
dt-bindings regulator: Updates for v5.11 2020-12-15 15:48:30 -08:00
keys
kunit
kvm
linux powercap/drivers/dtpm: Add CPU energy model based support 2020-12-22 19:50:40 +01:00
math-emu
media
memory
misc
net Networking updates for 5.11 2020-12-15 13:22:29 -08:00
pcmcia
ras
rdma
scsi
soc Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
sound ASoC: Updates for v5.11 2020-12-14 15:57:14 +01:00
target
trace Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
uapi platform-drivers-x86 for v5.11-1 2020-12-15 16:10:17 -08:00
vdso
video
xen