sysfs-platform_profile.rst 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. =====================================================================
  2. Platform Profile Selection (e.g. /sys/firmware/acpi/platform_profile)
  3. =====================================================================
  4. On modern systems the platform performance, temperature, fan and other
  5. hardware related characteristics are often dynamically configurable. The
  6. platform configuration is often automatically adjusted to the current
  7. conditions by some automatic mechanism (which may very well live outside
  8. the kernel).
  9. These auto platform adjustment mechanisms often can be configured with
  10. one of several platform profiles, with either a bias towards low power
  11. operation or towards performance.
  12. The purpose of the platform_profile attribute is to offer a generic sysfs
  13. API for selecting the platform profile of these automatic mechanisms.
  14. Note that this API is only for selecting the platform profile, it is
  15. NOT a goal of this API to allow monitoring the resulting performance
  16. characteristics. Monitoring performance is best done with device/vendor
  17. specific tools, e.g. turbostat.
  18. Specifically, when selecting a high performance profile the actual achieved
  19. performance may be limited by various factors such as: the heat generated
  20. by other components, room temperature, free air flow at the bottom of a
  21. laptop, etc. It is explicitly NOT a goal of this API to let userspace know
  22. about any sub-optimal conditions which are impeding reaching the requested
  23. performance level.
  24. Since numbers on their own cannot represent the multiple variables that a
  25. profile will adjust (power consumption, heat generation, etc) this API
  26. uses strings to describe the various profiles. To make sure that userspace
  27. gets a consistent experience the sysfs-platform_profile ABI document defines
  28. a fixed set of profile names. Drivers *must* map their internal profile
  29. representation onto this fixed set.
  30. If there is no good match when mapping then a new profile name may be
  31. added. Drivers which wish to introduce new profile names must:
  32. 1. Explain why the existing profile names cannot be used.
  33. 2. Add the new profile name, along with a clear description of the
  34. expected behaviour, to the sysfs-platform_profile ABI documentation.
  35. "Custom" profile support
  36. ========================
  37. The platform_profile class also supports profiles advertising a "custom"
  38. profile. This is intended to be set by drivers when the settings in the
  39. driver have been modified in a way that a standard profile doesn't represent
  40. the current state.
  41. Multiple driver support
  42. =======================
  43. When multiple drivers on a system advertise a platform profile handler, the
  44. platform profile handler core will only advertise the profiles that are
  45. common between all drivers to the ``/sys/firmware/acpi`` interfaces.
  46. This is to ensure there is no ambiguity on what the profile names mean when
  47. all handlers don't support a profile.
  48. Individual drivers will register a 'platform_profile' class device that has
  49. similar semantics as the ``/sys/firmware/acpi/platform_profile`` interface.
  50. To discover which driver is associated with a platform profile handler the
  51. user can read the ``name`` attribute of the class device.
  52. To discover available profiles from the class interface the user can read the
  53. ``choices`` attribute.
  54. If a user wants to select a profile for a specific driver, they can do so
  55. by writing to the ``profile`` attribute of the driver's class device.
  56. This will allow users to set different profiles for different drivers on the
  57. same system. If the selected profile by individual drivers differs the
  58. platform profile handler core will display the profile 'custom' to indicate
  59. that the profiles are not the same.
  60. While the ``platform_profile`` attribute has the value ``custom``, writing a
  61. common profile from ``platform_profile_choices`` to the platform_profile
  62. attribute of the platform profile handler core will set the profile for all
  63. drivers.