History

thermal: netlink: Add a new event to notify CPU capabilities change

Add a new netlink event to notify change in CPU capabilities in terms of performance and efficiency. Firmware may change CPU capabilities as a result of thermal events in the system or to account for changes in the TDP (thermal design power) level. This notification type will allow user space to avoid running workloads on certain CPUs or proactively adjust power limits to avoid future events. The netlink message consists of a nested attribute (THERMAL_GENL_ATTR_CPU_CAPABILITY) with three attributes: * THERMAL_GENL_ATTR_CPU_CAPABILITY_ID (type u32): -- logical CPU number * THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE (type u32): -- Scaled performance from 0-1023 * THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY (type u32): -- Scaled efficiency from 0-1023

Srinivas Pandruvada committed 4 years ago

Commit e4b1eb21 parent ab09b073 files · +72 −1Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/thermal.h+5−1
@@ -44,7 +44,10 @@ enum thermal_genl_attr { · 43 unmodified lines
4444 THERMAL_GENL_ATTR_CDEV_MAX_STATE,
4545 THERMAL_GENL_ATTR_CDEV_NAME,
4646 THERMAL_GENL_ATTR_GOV_NAME,
47−
47+ THERMAL_GENL_ATTR_CPU_CAPABILITY,
48+ THERMAL_GENL_ATTR_CPU_CAPABILITY_ID,
49+ THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE,
50+ THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY,
4851 __THERMAL_GENL_ATTR_MAX,
4952 };
5053 #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
@@ -71,6 +74,7 @@ enum thermal_genl_event { · 20 unmodified lines
7174 THERMAL_GENL_EVENT_CDEV_DELETE, /* Cdev unbound */
7275 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */
7376 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */
77+ THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE, /* CPU capability changed */
7478 __THERMAL_GENL_EVENT_MAX,
7579 };
7680 #define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)