linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Cross <ccross@android.com>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: Kevin Hilman <khilman@ti.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-pm@lists.linux-foundation.org,
	Len Brown <len.brown@intel.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Amit Kucheria <amit.kucheria@linaro.org>,
	Trinabh Gupta <g.trinabh@gmail.com>,
	Deepthi Dharwar <deepthi@linux.vnet.ibm.com>,
	linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 0/3] coupled cpuidle state support
Date: Tue, 13 Mar 2012 19:21:33 -0700	[thread overview]
Message-ID: <CAMbhsRSrS-gwu20Ba5=n_LNUwDh3p+5bQPOymGJ9x5O2Fn28kA@mail.gmail.com> (raw)
In-Reply-To: <4F5FFCC1.2030702@linux.intel.com>

On Tue, Mar 13, 2012 at 7:04 PM, Arjan van de Ven <arjan@linux.intel.com> wrote:
> On 3/13/2012 4:52 PM, Kevin Hilman wrote:
>> Checking the ready_count seemed like an easy way to do this, but did you
>> have any other mechanisms in mind for CPUs to communicate that they've
>> exited/aborted?
>
> this indeed is the tricky part (which I warned about earlier);
> I've spent quite a lot of time (weeks) to get this provably working for
> an Intel system with similar requirements... and it's extremely unfunny,
> and needed firmware support to close some of the race conditions.

As long as you can tell from cpu0 that cpu1 has succesfully entered
the low power state, this should be easy, and the
coupled_cpuidle_parallel_barrier helper should make it even easier.
This series just allows the exact same sequence of transitions used by
hotplug cpufreq governors to happen from the idle thread:

1. cpu0 forces cpu1 offline.  From a wakeup perspective, this is
exactly like hotplug removing cpu1.  Unlike hotplug, the state of cpu1
has to be saved, and the scheduler is not told that the cpu is gone.
Instead of using the IPI signalling that hotplug uses, we call the
same function on both cpus, and one cpu runs the equivalent of
platform_cpu_kill, and the other the equivalent of platform_cpu_die.
Wakeup events that are only targeted at cpu1 will need to be
temporarily migrated to cpu0.
2. If the hotplug is successful, cpu0 goes to a low power state, the
same way it would when the hotplug cpufreq governor had removed cpu1.
3. cpu0 wakes up, because all wakeup events are pointed at it.
4. After restoring its own state, cpu0 brings cpu1 back online,
exactly like hotplug online would, except that the boot vector has to
point to a cpu_resume handler instead of secondary start.

> I sure hope that hardware with these requirements is on the way out...
> it's not very OS friendly.

Even hardware that was designed not not have these requirements
sometimes has bugs that require this kind of sequencing.  OMAP4430
should theoretically support idle without sequencing, but OMAP4460
introduced a ROM code bug that requires sequencing again (turning on
cpu1 corrupts the interrupt controller, so cpu0 has to be waiting with
interrupts off to run a workaround whenever cpu1 turns on).

Out of curiosity, what Intel hardware needs this?

      reply	other threads:[~2012-03-14  2:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  0:09 [PATCH 0/3] coupled cpuidle state support Colin Cross
2011-12-21  0:09 ` [PATCH 1/3] cpuidle: refactor out cpuidle_enter_state Colin Cross
2012-01-04 14:08   ` [linux-pm] " Jean Pihet
2011-12-21  0:09 ` [PATCH 2/3] cpuidle: fix error handling in __cpuidle_register_device Colin Cross
2011-12-21  0:09 ` [PATCH 3/3] cpuidle: add support for states that affect multiple cpus Colin Cross
2011-12-21  9:02 ` [PATCH 0/3] coupled cpuidle state support Arjan van de Ven
2011-12-21  9:40   ` Colin Cross
2011-12-21  9:44     ` Arjan van de Ven
2011-12-21  9:55       ` Colin Cross
2011-12-21 12:12         ` Arjan van de Ven
2011-12-21 19:05           ` Colin Cross
2011-12-21 19:36             ` Arjan van de Ven
2011-12-21 19:42               ` [linux-pm] " Colin Cross
2011-12-22  8:35                 ` Shilimkar, Santosh
2011-12-22  8:53                   ` Arjan van de Ven
2011-12-22  9:30                     ` Shilimkar, Santosh
2011-12-22 21:20                     ` Colin Cross
2012-03-14  0:39           ` Colin Cross
2012-01-04  0:41 ` Kevin Hilman
2012-01-04 17:27   ` Shilimkar, Santosh
2012-01-20  8:46 ` Daniel Lezcano
2012-01-20 20:40   ` Colin Cross
2012-01-25 14:04     ` Daniel Lezcano
2012-01-31 14:13       ` Daniel Lezcano
2012-01-27  8:54     ` [linux-pm] " Vincent Guittot
2012-01-27 17:32       ` Colin Cross
2012-02-01 12:13         ` Vincent Guittot
2012-02-01 14:59           ` Lorenzo Pieralisi
2012-02-01 17:30             ` Colin Cross
2012-02-01 18:07               ` Lorenzo Pieralisi
2012-02-03  1:19                 ` Colin Cross
     [not found]   ` <8762e8kqi6.fsf@ti.com>
2012-03-14  0:28     ` Colin Cross
2012-03-14  0:47       ` Colin Cross
2012-03-14 14:23         ` [linux-pm] " Kevin Hilman
2012-03-14  2:04     ` Arjan van de Ven
2012-03-14  2:21       ` Colin Cross [this message]

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='CAMbhsRSrS-gwu20Ba5=n_LNUwDh3p+5bQPOymGJ9x5O2Fn28kA@mail.gmail.com' \
    --to=ccross@android.com \
    --cc=amit.kucheria@linaro.org \
    --cc=arjan@linux.intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=deepthi@linux.vnet.ibm.com \
    --cc=g.trinabh@gmail.com \
    --cc=khilman@ti.com \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    /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).