RFC: offering a standardized (/sys/class) userspace API for selecting system/laptop performance-profiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Elia, Mark, et al.

Elia, Mark I'm mailing you both because both of you have pdx86 patches pending to add a vendor
specific sysfs-attribute for selecting performance-profiles for resp. HP and Lenovo Thinkpad laptops.

I think that this shows that we might need to start thinking
about a generic kernel API for this, otherwise we will
end up with slight different options per vendor ...

So it seems we may need something like:

/sys/class/system_performance_profile

Where we would then get e.g.:

/sys/class/system_performance_profile/thinkpad_acpi/performance_profile

And then we need to standardize on the names/values which
performance_profile can show / accept when written too.

The big question is what do we do if there are more then 3 profiles?

One option would be something like the following:

cat /sys/class/system_performance_profile/thinkpad_acpi/performance_profile

low-power [balanced] performance

cat /sys/class/system_performance_profile/thinkpad_acpi/extra_performance_profiles

extra-low-power balanced-performance-mix

So we add an optional extra_performance_profiles sysfs attribute and we ask all
drivers implemeting this class to implement at least the 3 standard profiles
(by mapping 3 of their options to these) and optional they can offer extra
profiles (with free form names) in the extra_performance_profiles
sysfs attribute under the class-device.

The idea behind putting the extra profiles in a separate sysfs-attribute
is that reading the main performance_profile attribute will always show
one selected, even if one of the extra profiles is actually in use,
then the driver should also show the closest standardized profile as
being active.

This will allow userspace code to always rely on the standard interface
both for getting a representation of the currently active profile as well
as for setting the active profile.

Elia, Mark, I assume that both of you want to get your patches for this
upstream sooner, rather then later. But I think we should put them on
hold until we have an agreement on a shared userspace API for this.

I would like to think that the above proposal is a good start,
if we can quickly (*) decide on an userspace API here

Regards,

Hans

p.s.

I guess we should also add an optional lap_mode sysfs attribute
to the class-device, to have all the info for the Thinkpads in
one place.


*) but not too quickly, it is important we get this right




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux