All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] devfreq_cooling: let the driver supply the real power every time we need it
@ 2017-03-14 13:06 Lukasz Luba
  2017-03-14 13:06 ` [PATCH v3 1/3] thermal: devfreq_cooling: refactor code and add get_voltage function Lukasz Luba
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lukasz Luba @ 2017-03-14 13:06 UTC (permalink / raw)
  To: linux-pm; +Cc: chris.diamand, lukasz.luba, javi.merino, rui.zhang, edubezval

Hi,

This patchset introduces a new interface for devfreq cooling in thermal
framework. The previous version of the patch can be seen here [1].
I have simplified the implementation and introduced resource utilization
scaling factor.

The current implementation in the thermal devfreq cooling subsystem uses
pre-calculated power table for each device to make a decision about allowed
running state. When the driver registers itself to the thermal devfreq cooling
subsystem, the framework creates the power table.
The power table is then used by the thermal subsystem to keep
the device in the thermal envelope.
In the previous implementation the pre-calculated device's power
table was scaled by current 'utilization'
('busy_time' and 'total_time' taken from devfreq 'last_status').

This idea meets the expectations of the devices which know better the actual
power that they consume (thanks to power counters). When some
parts/features of the device are not used the power value might be lower,
while the frequency and utilization are the same.

The proposed implementation provides possibility to register a driver to
thermal devfreq cooling subsystem and use the driver's code during the 
calculation of the power in runtime.

The device driver can still use pre-calculated power table when these new 
functions are not provided (the new extension can co-exist with old 
implementation).

The first patch contains some refactoring for getting the voltage,
the second implements the new feature, the third one changes trace function.
Patchset is based on v4.11-rc2.

Changes
v3:
- use new OPP interface (no need to lock rcu)
v2 [2]: 
- removed 'flags' and power2state function,
- split into a few patches,
- simplified the logic of the new interface,
- added resource utilization scaling factor,
v1 [1]:
- basic implementation

Best Regards,
Lukasz Luba

[1] https://marc.info/?l=linux-pm&m=147395070729989&w=2
[2] http://marc.info/?l=linux-pm&m=148587920122854&w=2

Lukasz Luba (3):
  thermal: devfreq_cooling: refactor code and add get_voltage function
  thermal: devfreq_cooling: add new interface for direct power read
  trace: thermal: add another parameter *power to the tracing function

 drivers/thermal/devfreq_cooling.c | 117 ++++++++++++++++++++++++++++----------
 include/linux/devfreq_cooling.h   |  17 ++++++
 include/trace/events/thermal.h    |  11 ++--
 3 files changed, 110 insertions(+), 35 deletions(-)

-- 
2.9.2

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH v3 0/3] devfreq_cooling: let the driver supply the
@ 2017-05-04 11:34 Lukasz Luba
  2017-05-04 11:34 ` [PATCH v3 1/3] thermal: devfreq_cooling: refactor code and add get_voltage function Lukasz Luba
  0 siblings, 1 reply; 6+ messages in thread
From: Lukasz Luba @ 2017-05-04 11:34 UTC (permalink / raw)
  To: linux-pm; +Cc: rui.zhang, edubezval, javi.merino, chris.diamand, lukasz.luba

Hi,

This patchset introduces a new interface for devfreq cooling in thermal
framework. The first version of the patch can be seen here [1], second [2].
I have simplified the implementation and introduced resource utilization
scaling factor.

The current implementation in the thermal devfreq cooling subsystem uses
pre-calculated power table for each device to make a decision about allowed
running state. When the driver registers itself to the thermal devfreq cooling
subsystem, the framework creates the power table.
The power table is then used by the thermal subsystem to keep
the device in the thermal envelope.
In the previous implementation the pre-calculated device's power
table was scaled by current 'utilization'
('busy_time' and 'total_time' taken from devfreq 'last_status').

This idea meets the expectations of the devices which know better the actual
power that they consume (thanks to power counters). When some
parts/features of the device are not used the power value might be lower,
while the frequency and utilization are the same.

The proposed implementation provides possibility to register a driver to
thermal devfreq cooling subsystem and use the driver's code during the
calculation of the power in runtime.

The device driver can still use pre-calculated power table when these new
functions are not provided (the new extension can co-exist with old
implementation).

The first patch contains some refactoring for getting the voltage,
the second implements the new feature, the third one changes trace function.
Patchset is based on v4.11-rc8.


Changes
v3:
- refactor OPP code to fit into new dev_pm_opp API
v2: 
- removed 'flags' and power2state function,
- split into a few patches,
- simplified the logic of the new interface,
- added resource utilization scaling factor,

Regards,
Lukasz Luba

[1] https://marc.info/?l=linux-pm&m=147395070729989&w=2
[2] http://marc.info/?l=linux-pm&m=148587920122854&w=2

Lukasz Luba (3):
  thermal: devfreq_cooling: refactor code and add get_voltage function
  thermal: devfreq_cooling: add new interface for direct power read
  trace: thermal: add another parameter 'power' to the tracing function

 drivers/thermal/devfreq_cooling.c | 152 ++++++++++++++++++++++++++++----------
 include/linux/devfreq_cooling.h   |  19 +++++
 include/trace/events/thermal.h    |  11 ++-
 3 files changed, 137 insertions(+), 45 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-04 11:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 13:06 [PATCH v3] devfreq_cooling: let the driver supply the real power every time we need it Lukasz Luba
2017-03-14 13:06 ` [PATCH v3 1/3] thermal: devfreq_cooling: refactor code and add get_voltage function Lukasz Luba
2017-03-14 13:06 ` [PATCH v3 2/3] thermal: devfreq_cooling: add new interface for direct power read Lukasz Luba
2017-03-14 13:06 ` [PATCH v3 3/3] trace: thermal: add another parameter *power to the tracing function Lukasz Luba
2017-03-14 13:44   ` Steven Rostedt
2017-05-04 11:34 [PATCH v3 0/3] devfreq_cooling: let the driver supply the Lukasz Luba
2017-05-04 11:34 ` [PATCH v3 1/3] thermal: devfreq_cooling: refactor code and add get_voltage function Lukasz Luba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.