Skip to contentSkip to conversation

thermal: intel: Remove explicit user_space governor selection

PATCH Applied Srinivas Pandruvada 2 participants 2 messages Dec 16, 2024 – Dec 18, 2024 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: intel: Remove explicit user_space governor selection

Currently some user space programs like Linux thermald needs to register to get notifications from both thermal user space governor and also Thermal netlink. This is required as some messages like HFI (Hardware Feedback Notifications) requires Thermal netlink.

This results in additional processing in kernel and user space to process both notifications. The cost of using user space governor using kobject_uevent is much higher as this is also used by other user space daemons like udev daemon.

Do not select user_space thermal governor by default. If it is present user space programs can always use this governor by writing to "policy" attribute.

Instead from the kernel select THERMAL_NETLINK. Trip temperature violation can be received by user space programs via thermal netlink events:
THERMAL_GENL_EVENT_TZ_TRIP_UP THERMAL_GENL_EVENT_TZ_TRIP_DOWN

---
 drivers/thermal/intel/Kconfig                                   | 2 +-
 drivers/thermal/intel/int340x_thermal/Kconfig                   | 2 +-
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c         | 1 -
 drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c    | 1 -
 .../intel/int340x_thermal/processor_thermal_device_pci.c        | 1 -
 5 files changed, 2 insertions(+), 5 deletions(-)
drivers/thermal/intel/Kconfig +1 -1
index a31f2f32996a..9c0f66f9defc 100644
@@ -22,7 +22,7 @@ config INTEL_TCC
 config X86_PKG_TEMP_THERMAL
 	tristate "X86 package temperature thermal driver"
 	depends on X86_THERMAL_VECTOR
-	select THERMAL_GOV_USER_SPACE
+	select THERMAL_NETLINK
 	select INTEL_TCC
 	default m
 	help
drivers/thermal/intel/int340x_thermal/Kconfig +1 -1
index e76b13e44d03..d9a74424c29d 100644
@@ -6,7 +6,7 @@
 config INT340X_THERMAL
 	tristate "ACPI INT340X thermal drivers"
 	depends on X86_64 && ACPI && PCI
-	select THERMAL_GOV_USER_SPACE
+	select THERMAL_NETLINK
 	select ACPI_THERMAL_REL
 	select ACPI_FAN
 	select ACPI_THERMAL_LIB
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +0 -1
index 8660ef2175be..cbfae5b9668c 100644
@@ -521,7 +521,6 @@ static struct thermal_zone_device_ops int3400_thermal_ops = {
 };
 
 static struct thermal_zone_params int3400_thermal_params = {
-	.governor_name = "user_space",
 	.no_hwmon = true,
 };
 
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +0 -1
index 31ed338eb83c..8dca6a6aceca 100644
@@ -105,7 +105,6 @@ static int int340x_thermal_read_trips(struct acpi_device *zone_adev,
 }
 
 static struct thermal_zone_params int340x_thermal_params = {
-	.governor_name = "user_space",
 	.no_hwmon = true,
 };
 
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0 -1
index e8c0bb536862..b307889103d3 100644
@@ -272,7 +272,6 @@ static const struct thermal_zone_device_ops tzone_ops = {
 };
 
 static struct thermal_zone_params tzone_params = {
-	.governor_name = "user_space",
 	.no_hwmon = true,
 };
 
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 85 lines · Srinivas Pandruvada

Currently some user space programs like Linux thermald needs to register to get notifications from both thermal user space governor and also Thermal netlink. This is required as some messages like HFI (Hardware Feedback Notifications) requires Thermal netlink.

This results in additional processing in kernel and user space to process both notifications. The cost of using user space governor using kobject_uevent is much higher as this is also used by other user space daemons like udev daemon.

Do not select user_space thermal governor by default. If it is present user space programs can always use this governor by writing to "policy" attribute.

Instead from the kernel select THERMAL_NETLINK. Trip temperature violation can be received by user space programs via thermal netlink events:
THERMAL_GENL_EVENT_TZ_TRIP_UP THERMAL_GENL_EVENT_TZ_TRIP_DOWN

---
 drivers/thermal/intel/Kconfig                                   | 2 +-
 drivers/thermal/intel/int340x_thermal/Kconfig                   | 2 +-
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c         | 1 -
 drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c    | 1 -
 .../intel/int340x_thermal/processor_thermal_device_pci.c        | 1 -
 5 files changed, 2 insertions(+), 5 deletions(-)
drivers/thermal/intel/Kconfig +1 -1
index a31f2f32996a..9c0f66f9defc 100644
@@ -22,7 +22,7 @@ config INTEL_TCC
 config X86_PKG_TEMP_THERMAL
        tristate "X86 package temperature thermal driver"
        depends on X86_THERMAL_VECTOR
-       select THERMAL_GOV_USER_SPACE
+       select THERMAL_NETLINK
        select INTEL_TCC
        default m
        help
drivers/thermal/intel/int340x_thermal/Kconfig +1 -1
index e76b13e44d03..d9a74424c29d 100644
@@ -6,7 +6,7 @@
 config INT340X_THERMAL
        tristate "ACPI INT340X thermal drivers"
        depends on X86_64 && ACPI && PCI
-       select THERMAL_GOV_USER_SPACE
+       select THERMAL_NETLINK
        select ACPI_THERMAL_REL
        select ACPI_FAN
        select ACPI_THERMAL_LIB
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +0 -1
index 8660ef2175be..cbfae5b9668c 100644
@@ -521,7 +521,6 @@ static struct thermal_zone_device_ops int3400_thermal_ops = {
 };
 
 static struct thermal_zone_params int3400_thermal_params = {
-       .governor_name = "user_space",
        .no_hwmon = true,
 };
 
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +0 -1
index 31ed338eb83c..8dca6a6aceca 100644
@@ -105,7 +105,6 @@ static int int340x_thermal_read_trips(struct acpi_device *zone_adev,
 }
 
 static struct thermal_zone_params int340x_thermal_params = {
-       .governor_name = "user_space",
        .no_hwmon = true,
 };
 
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0 -0
index e8c0bb536862..b307889103d3 100644

drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c static const struct thermal_zone_device_ops tzone_ops = {

Quoted 8 lines
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0 -2
@@ -272,7 +272,6 @@ static const struct thermal_zone_device_ops tzone_ops = {
 };
 
 static struct thermal_zone_params tzone_params = {
-       .governor_name = "user_space",
        .no_hwmon = true,
 };
 
--

Applied as 6.14 material, thanks!