All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Pan <jacob.jun.pan@linux.intel.com>
To: Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Rafael Wysocki <rafael.j.wysocki@intel.com>,
	Len Brown <len.brown@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Zhang Rui <rui.zhang@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Subject: [PATCH 3/3] thermal/powerclamp: communicate with pm qos when injecting idle
Date: Tue, 26 Nov 2013 15:20:11 -0800	[thread overview]
Message-ID: <1385508011-26914-4-git-send-email-jacob.jun.pan@linux.intel.com> (raw)
In-Reply-To: <1385508011-26914-1-git-send-email-jacob.jun.pan@linux.intel.com>

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 <jacob.jun.pan@linux.intel.com>
---
 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 <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/sched/rt.h>
+#include <linux/pm_qos.h>
 
 #include <asm/nmi.h>
 #include <asm/msr.h>
@@ -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,
-- 
1.8.1.2


  parent reply	other threads:[~2013-11-26 23:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 23:20 [PATCH 0/3] Hook up powerclamp with PM QOS and cpuidle Jacob Pan
2013-11-26 23:20 ` [PATCH 1/3] pm/qos: allow state control of qos class Jacob Pan
2013-11-26 23:28   ` Rafael J. Wysocki
2014-01-16  1:17     ` Rafael J. Wysocki
2014-01-21 22:10       ` Jacob Pan
2014-01-21 23:15         ` Rafael J. Wysocki
2014-01-21 23:47           ` Jacob Pan
2013-11-26 23:20 ` [PATCH 2/3] cpuidle: check for pm qos constraint override Jacob Pan
2013-11-26 23:20 ` Jacob Pan [this message]
2013-11-27 11:56 ` [PATCH 0/3] Hook up powerclamp with PM QOS and cpuidle Peter Zijlstra
2013-11-27 16:47   ` jacob pan
2013-11-27 20:47     ` Rafael J. Wysocki

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=1385508011-26914-4-git-send-email-jacob.jun.pan@linux.intel.com \
    --to=jacob.jun.pan@linux.intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=arjan@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rui.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.