linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,
	Nishanth Menon <nm@ti.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 00/12] PM / OPP: Use kref and move away from RCU locking
Date: Wed,  7 Dec 2016 16:07:38 +0530	[thread overview]
Message-ID: <cover.1481106919.git.viresh.kumar@linaro.org> (raw)

Hi Rafael,

You can pretty much ignore this series until all other OPP cleanup/fixes
get merged. I am posting these to get early reviews from Stephen as
these patches have been lying with me for almost a week now. And I am
also _not_ pushing these for 4.10-rc1. It all depends on how the reviews
go.

The RCU locking isn't well suited for the OPP core. The RCU locking fits
better for reader heavy stuff, while the OPP core have at max one or two
readers only at a time.

Over that, it was getting very confusing the way RCU locking was used
within the OPP core. The individual OPPs are mostly well handled, i.e.
for an update a new structure was created and then that replaced the
older one. But the OPP tables were updated directly all the time from
various parts of the core. Though they were mostly used from within RCU
locked region, they didn't had much to do with RCU and were governed by
the mutex instead.

And that mixed with the 'opp_table_lock' has made the core even more
confusing.

Similar concerns were shared by Stephen Boyd earlier [1].

This patchset simplifies the locking in OPP core to great extent using
Kernel reference counting mechanism along with per OPP table mutex.
And finally it gets rid of RCU locking as well.

Each and every patch of this series is individually:
- build tested
- boot tested with cpufreq-dt.ko module. Insmod and rmmod to make sure
  the OPPs and the OPP tables are getting freed.

More testing is also done by various build and boot bots for last few
days. And they reported lots of issues (both build and boot time) that
helped making this series more robust:
- Kernel CI (Linaro)
- Fengguang Wu's bot (Intel)

This series has few dependencies though. It is rebased over:
  pm/bleeding-edge
  + OPP cleanup series [2]
  + few devfreq fixes [3], [4], and [5].
  + A recent revert [6]

Though all of those shall get merged before we end up reviewing this
series.

--
viresh

[1] https://marc.info/?l=linux-kernel&m=147742717527548&w=2
[2] https://marc.info/?l=linux-pm&m=148108573618896&w=2
[3] https://patchwork.kernel.org/patch/9455789/
[4] https://patchwork.kernel.org/patch/9455757/
[5] https://marc.info/?l=linux-pm&m=148090824301852&w=2
[6] https://marc.info/?l=linux-kernel&m=148110674223377&w=2

Viresh Kumar (12):
  PM / OPP: Add per OPP table mutex
  PM / OPP: Add 'struct kref' to OPP table
  PM / OPP: Return opp_table from dev_pm_opp_set_*() routines
  PM / OPP: Take reference of the OPP table while adding/removing OPPs
  PM / OPP: Use dev_pm_opp_get_opp_table() instead of _add_opp_table()
  PM / OPP: Add 'struct kref' to struct dev_pm_opp
  PM / OPP: Update OPP users to put reference
  PM / OPP: Take kref from _find_opp_table()
  PM / OPP: Move away from RCU locking
  PM / OPP: Simplify _opp_set_availability()
  PM / OPP: Simplify dev_pm_opp_get_max_volt_latency()
  PM / OPP: Update Documentation to remove RCU specific bits

 Documentation/power/opp.txt          |  47 +-
 arch/arm/mach-omap2/pm.c             |   5 +-
 drivers/base/power/opp/core.c        | 888 +++++++++++------------------------
 drivers/base/power/opp/cpu.c         |  66 +--
 drivers/base/power/opp/of.c          |  94 +---
 drivers/base/power/opp/opp.h         |  31 +-
 drivers/clk/tegra/clk-dfll.c         |  17 +-
 drivers/cpufreq/exynos5440-cpufreq.c |   5 +-
 drivers/cpufreq/imx6q-cpufreq.c      |  10 +-
 drivers/cpufreq/mt8173-cpufreq.c     |   8 +-
 drivers/cpufreq/omap-cpufreq.c       |   4 +-
 drivers/cpufreq/sti-cpufreq.c        |  13 +-
 drivers/devfreq/devfreq.c            |  14 +-
 drivers/devfreq/exynos-bus.c         |  14 +-
 drivers/devfreq/governor_passive.c   |   4 +-
 drivers/devfreq/rk3399_dmc.c         |  16 +-
 drivers/devfreq/tegra-devfreq.c      |   4 +-
 drivers/thermal/cpu_cooling.c        |  11 +-
 drivers/thermal/devfreq_cooling.c    |  14 +-
 include/linux/pm_opp.h               |  48 +-
 20 files changed, 429 insertions(+), 884 deletions(-)

-- 
2.7.1.410.g6faf27b

             reply	other threads:[~2016-12-07 10:37 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 10:37 Viresh Kumar [this message]
2016-12-07 10:37 ` [PATCH 01/12] PM / OPP: Add per OPP table mutex Viresh Kumar
2017-01-09 23:11   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table Viresh Kumar
2017-01-09 23:36   ` Stephen Boyd
2017-01-10  4:23     ` Viresh Kumar
2017-01-13  8:54       ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 03/12] PM / OPP: Return opp_table from dev_pm_opp_set_*() routines Viresh Kumar
2017-01-09 23:37   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 04/12] PM / OPP: Take reference of the OPP table while adding/removing OPPs Viresh Kumar
2017-01-09 23:38   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 05/12] PM / OPP: Use dev_pm_opp_get_opp_table() instead of _add_opp_table() Viresh Kumar
2017-01-09 23:43   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 06/12] PM / OPP: Add 'struct kref' to struct dev_pm_opp Viresh Kumar
2017-01-09 23:44   ` Stephen Boyd
2017-01-10  4:26     ` Viresh Kumar
2017-01-13  8:52       ` Stephen Boyd
2017-01-13  8:56         ` Viresh Kumar
2017-01-19 20:01           ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 07/12] PM / OPP: Update OPP users to put reference Viresh Kumar
2016-12-07 13:23   ` Chanwoo Choi
2016-12-08  4:00     ` Viresh Kumar
2017-01-21  7:42       ` Chanwoo Choi
2016-12-07 10:37 ` [PATCH 08/12] PM / OPP: Take kref from _find_opp_table() Viresh Kumar
2017-01-09 23:49   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 09/12] PM / OPP: Move away from RCU locking Viresh Kumar
2017-01-09 23:57   ` Stephen Boyd
2017-01-10  4:28     ` Viresh Kumar
2016-12-07 10:37 ` [PATCH 10/12] PM / OPP: Simplify _opp_set_availability() Viresh Kumar
2017-01-10  0:00   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 11/12] PM / OPP: Simplify dev_pm_opp_get_max_volt_latency() Viresh Kumar
2017-01-09 22:40   ` Stephen Boyd
2016-12-07 10:37 ` [PATCH 12/12] PM / OPP: Update Documentation to remove RCU specific bits Viresh Kumar
2017-01-09 22:39   ` Stephen Boyd
2017-01-10  4:39     ` Viresh Kumar
2017-01-13  8:44       ` Stephen Boyd
2016-12-07 23:14 ` [PATCH 00/12] PM / OPP: Use kref and move away from RCU locking Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1481106919.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).