All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] PM: QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY
@ 2019-11-18 22:56 Leonard Crestez
  2019-11-18 22:56 ` [PATCH v2 1/2] PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs Leonard Crestez
  2019-11-18 22:56 ` [PATCH v2 2/2] PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY Leonard Crestez
  0 siblings, 2 replies; 4+ messages in thread
From: Leonard Crestez @ 2019-11-18 22:56 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: MyungJoo Ham, Kyungmin Park, Matthias Kaehlcke, Chanwoo Choi,
	Artur Świgoń, Jacky Bai, Angus Ainslie, linux-pm,
	linux-imx

Support for frequency limits in dev_pm_qos was removed when cpufreq was
switched to freq_qos, this series attempts to restore it by
reimplementing top of freq_qos.

Previous discussion here:

https://lore.kernel.org/linux-pm/VI1PR04MB7023DF47D046AEADB4E051EBEE680@VI1PR04MB7023.eurprd04.prod.outlook.com/T/#u

The cpufreq core switched away because it needs contraints at the level
of a "cpufreq_policy" which cover multiple cpus so dev_pm_qos coupling
to struct device was not useful. Cpufreq could only use dev_pm_qos by
implementing an additional layer of aggregation anyway.

However the devfreq subsystem scaling is always performed for each
device so dev_pm_qos is a very good match.

In theory if freq_qos is extended to handle conflicting min/max values then
this sharing would be useful. Right now freq_qos just ties two unrelated
pm_qos aggregations for min and max freq.

---
This is implemented by embeding a freq_qos_request inside dev_pm_qos_request:
the data field was already an union in order to deal with flag requests.

The internal freq_qos_apply is exported so that it can be called from
dev_pm_qos apply_constraints.

The dev_pm_qos_constraints_destroy function has no obvious equivalent in
freq_qos and the whole approach of "removing requests" is somewhat
dubios: request objects should be owned by consumers and the list of qos
requests should be empty when the target device is deleted.

Clearing the request list and would likely result in a WARN next time
"update_request" is called by the requestor. Perhaps constraints_destroy
should dev_warn if lists are not empty? That would be an unrelated fix
for PM QoS.

Changes since v1:
* Don't add a leading underscore and EXPORT_SYMBOL_GPL the
freq_qos_apply function; just drop the static marker.
* Merged the freq_qos_apply export into the last patch.
Link to v1: https://patchwork.kernel.org/cover/11212887/

Leonard Crestez (2):
  PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs
  PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY

 drivers/base/power/qos.c | 69 +++++++++++++++++++++++++++++---
 include/linux/pm_qos.h   | 86 +++++++++++++++++++++++-----------------
 kernel/power/qos.c       |  4 +-
 3 files changed, 116 insertions(+), 43 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2019-11-21 23:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-18 22:56 [PATCH v2 0/2] PM: QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY Leonard Crestez
2019-11-18 22:56 ` [PATCH v2 1/2] PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs Leonard Crestez
2019-11-18 22:56 ` [PATCH v2 2/2] PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY Leonard Crestez
2019-11-21 23:26   ` Matthias Kaehlcke

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.