From patchwork Tue Nov 26 23:20:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Pan X-Patchwork-Id: 3241721 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2EE869F3AE for ; Tue, 26 Nov 2013 23:20:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 657B920553 for ; Tue, 26 Nov 2013 23:20:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87FBE20558 for ; Tue, 26 Nov 2013 23:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758389Ab3KZXUp (ORCPT ); Tue, 26 Nov 2013 18:20:45 -0500 Received: from mga14.intel.com ([143.182.124.37]:31266 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757595Ab3KZXUV (ORCPT ); Tue, 26 Nov 2013 18:20:21 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga102.ch.intel.com with ESMTP; 26 Nov 2013 15:20:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,778,1378882800"; d="scan'208";a="434758887" Received: from ultegra.jf.intel.com ([10.24.1.237]) by fmsmga001.fm.intel.com with ESMTP; 26 Nov 2013 15:20:19 -0800 From: Jacob Pan To: Linux PM , LKML , Peter Zijlstra , Rafael Wysocki , Len Brown , Arjan van de Ven , Zhang Rui Cc: Jacob Pan Subject: [PATCH 3/3] thermal/powerclamp: communicate with pm qos when injecting idle Date: Tue, 26 Nov 2013 15:20:11 -0800 Message-Id: <1385508011-26914-4-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1385508011-26914-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1385508011-26914-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During idle injection period, CPU PM QOS class shall be ignored. This will indirectly influence the idle governors to choose the deepest idle states. Signed-off-by: Jacob Pan --- drivers/thermal/intel_powerclamp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index de90f89..62dbf95 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -483,6 +484,10 @@ static int start_power_clamp(void) clamping = true; schedule_delayed_work(&poll_pkg_cstate_work, 0); + /* Tell PM QOS all CPU constraints are ignored during idle injection */ + pm_qos_set_constraint_class_state(PM_QOS_CPU_DMA_LATENCY, + PM_QOS_CONSTRAINT_IGNORED); + /* start one thread per online cpu */ for_each_online_cpu(cpu) { struct task_struct **p = @@ -524,6 +529,9 @@ static void end_power_clamp(void) kthread_stop(thread); } } + /* make CPU PM QOS active again */ + pm_qos_set_constraint_class_state(PM_QOS_CPU_DMA_LATENCY, + PM_QOS_CONSTRAINT_AVAILABLE); } static int powerclamp_cpu_callback(struct notifier_block *nfb,