linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFT][PATCH 0/3] cpufreq / PM: QoS: Introduce frequency QoS and use it in cpufreq
@ 2019-10-22 22:06 Leonard Crestez
  2019-10-22 22:47 ` Rafael J. Wysocki
  0 siblings, 1 reply; 25+ messages in thread
From: Leonard Crestez @ 2019-10-22 22:06 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: Linux ACPI, Linux PM, Sudeep Holla, Dmitry Osipenko,
	Matthias Kaehlcke, Kyungmin Park, Chanwoo Choi,
	Artur Świgoń,
	Georgi Djakov, dl-linux-imx, Saravana Kannan, MyungJoo Ham

Hello,

I've been working on a series which add DEV_PM_QOS support to devfreq, 
now at v9:

	https://patchwork.kernel.org/cover/11171807/

Your third patch removes DEV_PM_QOS_FREQUENCY_MIN/MAX that my series 
depends upon. I found the email on patchwork, hopefully the in-reply-to 
header is OK?

As far as I can tell the replacement ("frequency qos") needs constraints 
to be managed outside the device infrastructure and it's not obviously 
usable a generic mechanism for making "min_freq/max_freq" requests to a 
specific device.

I've read a bit through your emails and it seems the problem is that 
you're dealing with dev_pm_qos on per-policy basis but each "struct 
cpufreq_policy" can cover multiple CPU devices.

An alternative solution which follows dev_pm_qos would be to add 
notifiers for each CPU inside cpufreq_online and cpufreq_offline. This 
makes quite a bit of sense because each CPU is a separate "device" with 
a possibly distinct list of qos requests.

If cpufreq needs a group of CPUs to run at the same frequency then it 
should deal with this by doing dev_pm_qos_read_frequency on each CPU 
device and picking a frequency that attempts to satisfy all constraints.

Handling sysfs min/max_freq through dev_pm_qos would be of dubious 
value, though I guess you could register identical requests for each CPU.

I'm not familiar with what you're trying to accomplish with PM_QOS other 
than replace the sysfs min_freq/max_freq files: What I want to do is add 
a driver using the interconnect driver which translates requests for 
"bandwidth-on-a-path" into "frequency-on-a-device". More specifically a 
display driver could request bandwidth to RAM and this would be 
translated into min frequency for NoC and the DDR controller, both of 
which implement scaling via devfreq:

	https://patchwork.kernel.org/cover/11104113/
	https://patchwork.kernel.org/cover/11111865/

This is part of an effort to upstream an out-of-tree "busfreq" feature 
which allows device device to make "min frequency requests" through an 
entirely out-of-tree mechanism. It would also allow finer-grained 
scaling that what IMX tree currently support.

If you're making cpufreq qos constrains be "per-cpufreq-policy" then 
it's not clear how you would handle in-kernel constraints from other 
subsystems. Would users have to get a pointer to struct cpufreq_policy 
and struct freq_constraints? That would make object lifetime a 
nightmare! But dev_pm_qos solves this by tying to struct device.

And if you don't care about in-kernel requests then what's the purpose 
of involving PM QoS? The old min/max_freq sysfs implementation worked.

--
Regards,
Leonard

^ permalink raw reply	[flat|nested] 25+ messages in thread
* [RFT][PATCH 0/3] cpufreq / PM: QoS: Introduce frequency QoS and use it in cpufreq
@ 2019-10-16 10:37 Rafael J. Wysocki
  2019-10-16 14:23 ` Sudeep Holla
  2019-10-17  9:46 ` Viresh Kumar
  0 siblings, 2 replies; 25+ messages in thread
From: Rafael J. Wysocki @ 2019-10-16 10:37 UTC (permalink / raw)
  To: Linux PM; +Cc: Linux ACPI, LKML, Viresh Kumar, Sudeep Holla, Dmitry Osipenko

Hi All,

The motivation for this series is to address the problem discussed here:

https://lore.kernel.org/linux-pm/5ad2624194baa2f53acc1f1e627eb7684c577a19.1562210705.git.viresh.kumar@linaro.org/T/#md2d89e95906b8c91c15f582146173dce2e86e99f

and also reported here:

https://lore.kernel.org/linux-pm/20191015155735.GA29105@bogus/

Plus, generally speaking, using the policy CPU as a proxy for the policy
with respect to PM QoS does not feel particularly straightforward to me
and adds extra complexity.

Anyway, the first patch adds frequency QoS that is based on "raw" PM QoS (kind
of in analogy with device PM QoS) and is just about min and max frequency
requests (no direct relationship to devices).

The second patch switches over cpufreq and its users to the new frequency QoS.
[The Fixes: tag has been tentatively added to it.]

The third one removes frequency request types from device PM QoS.

Unfortunately, the patches are rather big, but also they are quite
straightforward.

I didn't have the time to test this series, so giving it a go would be much
appreciated.

Thanks,
Rafael




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

end of thread, other threads:[~2019-10-25 18:04 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 22:06 [RFT][PATCH 0/3] cpufreq / PM: QoS: Introduce frequency QoS and use it in cpufreq Leonard Crestez
2019-10-22 22:47 ` Rafael J. Wysocki
2019-10-23  2:20   ` Leonard Crestez
2019-10-23  8:54     ` Rafael J. Wysocki
2019-10-23  8:57       ` Rafael J. Wysocki
2019-10-23 13:33       ` Leonard Crestez
2019-10-24 13:42         ` Rafael J. Wysocki
2019-10-24 17:47           ` Leonard Crestez
2019-10-24 21:10             ` Rafael J. Wysocki
2019-10-25 18:04               ` Leonard Crestez
  -- strict thread matches above, loose matches on Subject: below --
2019-10-16 10:37 Rafael J. Wysocki
2019-10-16 14:23 ` Sudeep Holla
2019-10-17  9:57   ` Viresh Kumar
2019-10-17  9:59     ` Sudeep Holla
2019-10-17 16:34       ` Rafael J. Wysocki
2019-10-17 16:42         ` Sudeep Holla
2019-10-18  5:44         ` Viresh Kumar
2019-10-18  8:24           ` Rafael J. Wysocki
2019-10-18  8:27             ` Viresh Kumar
2019-10-18  8:30               ` Rafael J. Wysocki
2019-10-18  9:24                 ` Viresh Kumar
2019-10-18  9:26                   ` Rafael J. Wysocki
2019-10-18  9:28                     ` Viresh Kumar
2019-10-17 17:14   ` Sudeep Holla
2019-10-17  9:46 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).