From: Kevin Hilman <khilman@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
peterz@infradead.org, tglx@linutronix.de,
rafael.j.wysocki@intel.com, rlippert@google.com,
linux-pm@vger.kernel.org, linus.walleij@linaro.org,
linux-kernel@vger.kernel.org, mingo@redhat.com,
sudeep.holla@arm.com, linuxppc-dev@lists.ozlabs.org,
Lina Iyer <lina.iyer@linaro.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures
Date: Wed, 13 May 2015 15:59:55 -0700 [thread overview]
Message-ID: <7h7fsc2idw.fsf@deeprootsystems.com> (raw)
In-Reply-To: <2919083.VPTOth98op@vostro.rjw.lan> (Rafael J. Wysocki's message of "Tue, 12 May 2015 15:23:25 +0200")
"Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
[...]
> Second, quite honestly, I don't see a connection to genpd here.
The connection with genpd is because the *reason* the timer was
shutdown/stopped is because it shares power with the CPU, which is why
the timer stops when the CPU hits ceratin low power states. IOW, it's
in the same power domain as the CPU.
> What you seem to be saying is "maybe we can eliminate the need to check the
> return value of tick_broadcast_enter() in the idle loop if we proactively
> disable the TIMER_STOP idle states of a CPU when we start to use that CPU's
> timer as a broadcast one".
>
> So this seems to be about the timekeeping rather than power domains, because
> that's where the broadcast thing is done. So the code setting up the CPU's
> timer for broadcast would pretty much need to pause cpuidle, go through the
> CPU's idle states and disable the TIMER_STOP ones. And do the reverse when the
> timer is not going the be used for broadcast any more.
Or..., modify the timer subystem to use runtime PM on the timer devices,
create a genpd that includes the timer device, and use
pm_genpd_attach_cpuidle() to attach that genpd so that whenever that
timer is runtime PM active, the deeper C-states cannot be hit.
> So question is whether or not this is actually really more
> straightforward than checking the return value of
> tick_broadcast_enter() in the idle loop after all.
Unfortunetly this problem doesn't only affect timers.
Daniel's broader point is that $SUBJECT series only handles this for the
timer, but there's actually a more general problem to solve for *any*
device that shares a power domain with a CPU (e.g. CPU-local
timers, interrupt controllers, performance monitoring units, floating
point units, etc. etc.)
If we keep adding checks to the idle loop for all those devices, we're
heading for a mess. (In fact, this is exactly what CPUidle drivers in
lots of vendor trees are doing, and it is indeed quite messy, and very
vendor specific.)
Also, solving this more general problem was the primary motivation for
adding the gnpd _attach_cpuidle() feature in the first place, so why not
use that?
Longer term, IMO, these dependencies between CPUs and all these "extras"
logic that share a power domain should be modeled by a genpd. If all
those devices are using runtime PM, including the CPUs, and they are
grouped into a genpd, then we we can very easily know at the genpd level
whether or not the CPU could be powered down, and to what level. This
longer-term solution is what I want to discuss at LPC this year in my
"Unifiy idle management of CPUs and IO devices" topic[1]. ( Also FYI,
using a genpd to model a CPU and connected logic is part of the
motivation behind the recent proposals to add support for multiple
states to genpd by Axel Haslam. )
Anyways I digress...
In the short term, while your patches look fine to me, the objection I
have is that it's only a band-aid fix that handles timers, but none of
the other "extras" that might share a power rail with the CPU. So,
until we have the long-term stuff sorted out, the better
short-term solution IMO is the _attach_cpuidle() one above.
Kevin
[1] http://wiki.linuxplumbersconf.org/2015:energy-aware_scheduling
next prev parent reply other threads:[~2015-05-13 23:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 7:35 [PATCH V3] cpuidle: Handle tick_broadcast_enter() failure gracefully Preeti U Murthy
2015-05-08 12:43 ` Sudeep Holla
2015-05-08 14:18 ` Rafael J. Wysocki
2015-05-08 21:51 ` Rafael J. Wysocki
2015-05-09 5:49 ` Preeti U Murthy
2015-05-09 18:46 ` Rafael J. Wysocki
2015-05-09 18:48 ` Rafael J. Wysocki
2015-05-09 20:11 ` Rafael J. Wysocki
2015-05-09 20:33 ` Rafael J. Wysocki
2015-05-09 23:15 ` [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures Rafael J. Wysocki
2015-05-09 23:18 ` [PATCH 1/3] sched / idle: Call idle_set_state() from cpuidle_enter_state() Rafael J. Wysocki
2015-05-09 23:18 ` [PATCH 2/3] sched / idle: Call default_idle_call() " Rafael J. Wysocki
2015-05-09 23:19 ` [PATCH 3/3] cpuidle: Select a different state on tick_broadcast_enter() failures Rafael J. Wysocki
2024-08-21 9:51 ` Dhruva Gole
2024-08-21 11:25 ` Rafael J. Wysocki
2015-05-11 3:48 ` [PATCH 0/3] cpuidle: updates related to " Preeti U Murthy
2015-05-11 5:21 ` Preeti U Murthy
2015-05-11 23:13 ` Rafael J. Wysocki
2015-05-11 15:13 ` Sudeep Holla
2015-05-11 23:14 ` Rafael J. Wysocki
2015-05-11 17:40 ` Daniel Lezcano
2015-05-11 23:31 ` Rafael J. Wysocki
2015-05-12 8:41 ` Daniel Lezcano
2015-05-12 13:23 ` Rafael J. Wysocki
2015-05-12 18:04 ` Daniel Lezcano
2015-05-13 22:59 ` Kevin Hilman [this message]
2015-05-14 0:16 ` Rafael J. Wysocki
2015-05-14 0:13 ` Kevin Hilman
2015-05-14 0:42 ` Rafael J. Wysocki
2015-05-14 0:31 ` Kevin Hilman
2015-05-14 3:59 ` Preeti U Murthy
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=7h7fsc2idw.fsf@deeprootsystems.com \
--to=khilman@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=lina.iyer@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=preeti@linux.vnet.ibm.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
--cc=rlippert@google.com \
--cc=sudeep.holla@arm.com \
--cc=tglx@linutronix.de \
--cc=ulf.hansson@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