From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhang Rui Subject: Re: [PATCH v6 3/3] PM: Introduce Intel PowerClamp Driver Date: Wed, 16 Jan 2013 20:18:49 +0800 Message-ID: <1358338729.2252.53.camel@rzhang1-mobl4> References: <1357297965-17839-1-git-send-email-jacob.jun.pan@linux.intel.com> <1357297965-17839-4-git-send-email-jacob.jun.pan@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mga11.intel.com ([192.55.52.93]:30921 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752722Ab3APMS6 (ORCPT ); Wed, 16 Jan 2013 07:18:58 -0500 In-Reply-To: <1357297965-17839-4-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Jacob Pan Cc: Linux PM , LKML , Peter Zijlstra , Rafael Wysocki , Len Brown , Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , Joe Perches , Rob Landley , Arjan van de Ven , Paul McKenney Hi, Jacob, On Fri, 2013-01-04 at 03:12 -0800, Jacob Pan wrote: > Intel PowerClamp driver performs synchronized idle injection across > all online CPUs. The goal is to maintain a given package level C-stat= e > ratio. >=20 > Compared to other throttling methods already exist in the kernel, > such as ACPI PAD (taking CPUs offline) and clock modulation, this is = often > more efficient in terms of performance per watt. >=20 > Please refer to Documentation/thermal/intel_powerclamp.txt for more d= etails. >=20 > Signed-off-by: Arjan van de Ven > Signed-off-by: Jacob Pan > --- > Documentation/thermal/intel_powerclamp.txt | 307 +++++++++++ > drivers/thermal/Kconfig | 10 + > drivers/thermal/Makefile | 2 + > drivers/thermal/intel_powerclamp.c | 788 ++++++++++++++++++= ++++++++++ > 4 files changed, 1107 insertions(+) > create mode 100644 Documentation/thermal/intel_powerclamp.txt > create mode 100644 drivers/thermal/intel_powerclamp.c > diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig > index c2c77d1..7d90ab8 100644 > --- a/drivers/thermal/Kconfig > +++ b/drivers/thermal/Kconfig > @@ -122,4 +122,14 @@ config DB8500_CPUFREQ_COOLING > bound cpufreq cooling device turns active to set CPU frequency lo= w to > cool down the CPU. > =20 > +config INTEL_POWERCLAMP > + tristate "Intel PowerClamp idle injection driver" > + depends on THERMAL > + depends on X86 > + depends on CPU_SUP_INTEL > + help > + Enable this to enable Intel PowerClamp idle injection driver. Thi= s > + enforce idle time which results in more package C-state residency= =2E The > + user interface is exposed via generic thermal framework. > + > endif > diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile > index d8da683..574f5f5 100644 > --- a/drivers/thermal/Makefile > +++ b/drivers/thermal/Makefile > @@ -18,3 +18,5 @@ obj-$(CONFIG_RCAR_THERMAL) +=3D rcar_thermal.o > obj-$(CONFIG_EXYNOS_THERMAL) +=3D exynos_thermal.o > obj-$(CONFIG_DB8500_THERMAL) +=3D db8500_thermal.o > obj-$(CONFIG_DB8500_CPUFREQ_COOLING) +=3D db8500_cpufreq_cooling.o > +obj-$(CONFIG_INTEL_POWERCLAMP) +=3D intel_powerclamp.o > + > diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/int= el_powerclamp.c > new file mode 100644 > index 0000000..314b6fc > --- /dev/null > +++ b/drivers/thermal/intel_powerclamp.c > @@ -0,0 +1,788 @@ > +/* > + * intel_powerclamp.c - package c-state idle injection > + * > + * Copyright (c) 2012, Intel Corporation. > + * > + * Authors: > + * Arjan van de Ven > + * Jacob Pan > + * > + * This program is free software; you can redistribute it and/or mod= ify it > + * under the terms and conditions of the GNU General Public License, > + * version 2, as published by the Free Software Foundation. > + * > + * This program is distributed in the hope it will be useful, but WI= THOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILIT= Y or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Lic= ense for > + * more details. > + * > + * You should have received a copy of the GNU General Public License= along with > + * this program; if not, write to the Free Software Foundation, Inc.= , > + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * > + * TODO: > + * 1. better handle wakeup from external interrupts, curre= ntly a fixed > + * compensation is added to clamping duration when exce= ssive amount > + * of wakeups are observed during idle time. the reason= is that in > + * case of external interrupts without need for ack, cl= amping down > + * cpu in non-irq context does not reduce irq. for majo= rity of the > + * cases, clamping down cpu does help reduce irq as wel= l, we should > + * be able to differenciate the two cases and give a qu= antitative > + * solution for the irqs that we can control. perhaps b= ased on > + * get_cpu_iowait_time_us() > + * > + * 2. synchronization with other hw blocks > + * > + * > + */ > + > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + drivers/thermal/intel_powerclamp.c: In function =E2=80=98clamp_thread=E2= =80=99: drivers/thermal/intel_powerclamp.c:435:4: error: implicit declaration o= f function =E2=80=98local_touch_nmi=E2=80=99 [-Werror=3Dimplicit-function= -declaration] changing to=20 #include fixes the problem. thanks, rui