powercap: intel_rapl: Make cpu optional for rapl_package
mainline inclusion from mainline-v6.5-rc1 commit bf44b901 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I92135 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bf44b9011df3d6e34a23be77d86540553ba2bbe2 -------------------------------- MSR RAPL Interface always removes a rapl_package when all the CPUs in that rapl_package are offlined. This is because it relies on an online CPU to access the MSR. But for RAPL Interface using MMIO registers, when all the cpus within the rapl_package are offlined, 1. the register can still be accessed 2. monitoring and setting the Power Pimits for the rapl_package is still meaningful because of uncore power. This means that, a valid rapl_package doesn't rely on one or more cpus being onlined. For this sense, make cpu optional for rapl_package. A rapl_package can be registered either using a CPU id to represent the physical package/die, or using the physical package id directly. Note that, the thermal throttling interrupt is not disabled via MSR_IA32_PACKAGE_THERM_INTERRUPT for such rapl_package at the moment. If it is still needed in the future, this can be achieved by selecting an onlined CPU using the physical package id. Note that, processor_thermal_rapl, the current MMIO RAPL Interface driver, can also be converted to register using a package id instead. But this is not done right now because processor_thermal_rapl driver works on single-package systems only, and offlining the only package will not happen. So keep the previous logic. Intel-SIG: commit bf44b901 powercap: intel_rapl: Make cpu optional for rapl_package. Backport Intel RAPL driver support on TPMI. Signed-off-by:Zhang Rui <rui.zhang@intel.com> Tested-by:
Wang Wendy <wendy.wang@intel.com> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> [ Xiaolong Wang: amend commit log ] Signed-off-by:
Xiaolong Wang <xiaolong.wang@intel.com>
Loading
Please sign in to comment