From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756940Ab2D3VU0 (ORCPT ); Mon, 30 Apr 2012 17:20:26 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:46217 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755652Ab2D3VUZ (ORCPT ); Mon, 30 Apr 2012 17:20:25 -0400 From: "Rafael J. Wysocki" To: Colin Cross Subject: Re: [PATCHv3 0/5] coupled cpuidle state support Date: Mon, 30 Apr 2012 23:25:09 +0200 User-Agent: KMail/1.13.6 (Linux/3.4.0-rc5+; KDE/4.6.0; x86_64; ; ) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@lists.linux-foundation.org, Kevin Hilman , Len Brown , Trinabh Gupta , Arjan van de Ven , Deepthi Dharwar , "Greg Kroah-Hartman" , Kay Sievers , Santosh Shilimkar , Daniel Lezcano , Amit Kucheria , Lorenzo Pieralisi , Arnd Bergmann , Russell King , Len Brown References: <1335816551-27756-1-git-send-email-ccross@android.com> In-Reply-To: <1335816551-27756-1-git-send-email-ccross@android.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Message-Id: <201204302325.09505.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I have a comment, which isn't about the series itself, but something thay may be worth thinking about. On Monday, April 30, 2012, Colin Cross wrote: > On some ARM SMP SoCs (OMAP4460, Tegra 2, and probably more), the > cpus cannot be independently powered down, either due to > sequencing restrictions (on Tegra 2, cpu 0 must be the last to > power down), or due to HW bugs (on OMAP4460, a cpu powering up > will corrupt the gic state unless the other cpu runs a work > around). Each cpu has a power state that it can enter without > coordinating with the other cpu (usually Wait For Interrupt, or > WFI), and one or more "coupled" power states that affect blocks > shared between the cpus (L2 cache, interrupt controller, and > sometimes the whole SoC). Entering a coupled power state must > be tightly controlled on both cpus. That seems to be a special case of a more general situation where a number of CPU cores belong into a single power domain, possibly along some I/O devices. We'll need to handle the general case at one point anyway, so I wonder if the approach shown here may get us in the way? > The easiest solution to implementing coupled cpu power states is > to hotplug all but one cpu whenever possible, usually using a > cpufreq governor that looks at cpu load to determine when to > enable the secondary cpus. This causes problems, as hotplug is an > expensive operation, so the number of hotplug transitions must be > minimized, leading to very slow response to loads, often on the > order of seconds. This isn't a solution at all, rather a workaround and a poor one for that matter. > This patch series implements an alternative solution, where each > cpu will wait in the WFI state until all cpus are ready to enter > a coupled state, at which point the coupled state function will > be called on all cpus at approximately the same time. > > Once all cpus are ready to enter idle, they are woken by an smp > cross call. Is it really necessary to wake up all of the CPUs in WFI before going to deeper idle? We should be able to figure out when they are going to be needed next time without waking them up and we should know the latency to wake up from the deeper multi-CPU "C-state", so it should be possible to decide whether or not to go to deeper idle without the SMP cross call. Is there anything I'm missing here? Rafael