Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp725441imm; Fri, 14 Sep 2018 05:31:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaPCkcO8pEyV7khHYSgZCMsrznN8zwk0/pmqZ23roKaNcDQIAYzQAVihK11aiX+cT5qOtKe X-Received: by 2002:a63:da56:: with SMTP id l22-v6mr11799358pgj.179.1536928284797; Fri, 14 Sep 2018 05:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536928284; cv=none; d=google.com; s=arc-20160816; b=OlHHfIkYZfoFCztOVmFSunIXHjFOpvF0Egaey8Szsd6jmgNSufgNRht9cr7RzfeSht oWDSmhp/pFY7XZUNyrx8hYX05nyKVlNhGW0Ys5NiV0jbpDLj0q6pWayUPbmk5OyUp2Fx KV5B5AzhH8c60zSBC2NdDSppBina9DSu6qzT+LVNDEGnGWhA3NFxGyKElnvk/12OPVjA AZfkjkFbovWsnHlXP/OH0sytNrw4LvMOghl7x4fDm5AKTbKh7MeI0W8r2HKi5LuweaWg YkCxWuyxuA7vYMFoV7RfOod8Jcj1XQM0U4siiakXR81VUbge+lhO/n/xQB3RqZwqTckV 4ZkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bV3bB7Q86FZTd/FfuuT6yfAjoffDRHfFDBPwoxHOHxI=; b=DsOt9wngi3BBgMfAfKTZ6uDzlkAAkkv4RRTlpaO/VXRTEdjKZPa3RaEoiG2WrxlTCR r9eF9MlMpBQj/mDyBHpfrKcOCEHbC167k/v5Qp61SxIyR7j92bjgfXZfFCgHZcijCF0f iao7BYEbuC/eSb+PH2S/iIA0Rsyn6cFRe1BpdO9TCimoN9jlOeSmjrizJxIw/oNNOJkj Uk9aKyJZNjuZz5KtfLCvoyG+fu5P9hfSsvwCMb3UIF/MIvCz+sp6nXYlbf4uiah28JD8 FaMl4apHHYk+PwCByY3eCKHwUcKK/HQy1eZZfUGQxh8WtmQhk2quM2fLUYCJ5fJsf/IA qfuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2-v6si7027373pgk.330.2018.09.14.05.31.08; Fri, 14 Sep 2018 05:31:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbeINRpJ (ORCPT + 99 others); Fri, 14 Sep 2018 13:45:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60746 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726966AbeINRpI (ORCPT ); Fri, 14 Sep 2018 13:45:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D30C18A; Fri, 14 Sep 2018 05:30:52 -0700 (PDT) Received: from e107981-ln.cambridge.arm.com (e107981-ln.Emea.Arm.com [10.4.13.117]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C1B303F703; Fri, 14 Sep 2018 05:30:48 -0700 (PDT) Date: Fri, 14 Sep 2018 13:30:37 +0100 From: Lorenzo Pieralisi To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Ulf Hansson , Sudeep Holla , Mark Rutland , Linux PM , Kevin Hilman , Lina Iyer , Lina Iyer , Rob Herring , Daniel Lezcano , Thomas Gleixner , Vincent Guittot , Stephen Boyd , Juri Lelli , Geert Uytterhoeven , Linux ARM , linux-arm-msm , Linux Kernel Mailing List , Frederic Weisbecker , Ingo Molnar Subject: Re: [PATCH v8 07/26] PM / Domains: Add genpd governor for CPUs Message-ID: <20180914123037.GA22926@e107981-ln.cambridge.arm.com> References: <20180620172226.15012-1-ulf.hansson@linaro.org> <20180809153925.GA20329@red-moon> <5398488.CyAMIAYSYI@aspire.rjw.lan> <20180914104431.GA20567@e107981-ln.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 14, 2018 at 01:34:14PM +0200, Rafael J. Wysocki wrote: [...] > > > So for example, if your logical CPU has an idle state A that may trigger an > > > idle state X at the cluster level (if the other logical CPUs happen to be in > > > the right states and so on), then the worst-case exit latency for that > > > is the one of state X. > > > > I will provide an example: > > > > IDLE STATE A (affects CPU {0,1}): exit latency 1ms, min-residency 1.5ms > > > > CPU 0 is about to enter IDLE state A since its "next-event" fulfill the > > residency requirements and exit latency constraints. > > > > CPU 1 is in idle state A (given that CPU 0 is ON, some of the common > > logic shared between CPU {0,1} is still ON, but, as soon as CPU 0 > > enters idle state A CPU {0,1} can enter the "full" idle state A > > power savings mode). > > > > The current CPUidle governor does not check the "next-event" for CPU 1, > > that it may wake up in, say, 10us. > > Right. > > > Requesting IDLE STATE A is a waste of power (if firmware or hardware > > does not demote it since it does peek at CPU 1 next-event and actually > > demote CPU 0 request). > > OK, I see. > > That's because the state is "collaborative" so to speak. But was't > that supposed to be covered by the "coupled" thing? The coupled idle states code was merged because on some early SMP ARM platforms CPUs must enter cluster idle states orderly otherwise the system would break; "coupled" as-in "syncronized idle state entry". Basically coupled idle code fixed a HW bug. This series code instead applies to all arches where an idle state may span multiple CPUs (x86 inclusive, but as I mentioned it is probably not needed since FW/HW behind mwait is capable of detecting whether that's wortwhile to shut down, say, a package. PSCI, whether OSI or PC mode can work the same way). Entering an idle state spanning multiple cpus need not be synchronized but a sort of cpumask aware governor may help optimize idle state selection. I hope this makes the whole point clearer. Cheers, Lorenzo