All of lore.kernel.org
 help / color / mirror / Atom feed
* idle patches for 2.6.37
@ 2010-10-26 21:07 Len Brown
  2010-10-26 21:07 ` [PATCH 1/5] intel_idle: simplify test for leave_mm() Len Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Len Brown @ 2010-10-26 21:07 UTC (permalink / raw)
  To: linux-pm

I realized after I requested these patches for 2.6.37-merge
that I'd neglected to send the series to linux-pm -- so here they are.
Let me know if you see troubles with any of them.

thanks,
Len Brown, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] intel_idle: simplify test for leave_mm()
  2010-10-26 21:07 idle patches for 2.6.37 Len Brown
@ 2010-10-26 21:07 ` Len Brown
  2010-10-26 21:07   ` [PATCH 2/5] intel_idle: delete bogus data from cpuidle_state.power_usage Len Brown
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Len Brown @ 2010-10-26 21:07 UTC (permalink / raw)
  To: linux-pm; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

A run-time test to invoke leave_mm() for the deepest
supported C-state is redundant, since the appropriate
C-states already have flags with CPUIDLE_FLAG_TLB_FLUSHED set.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/idle/intel_idle.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index c37ef64..ad0fb01 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -186,13 +186,10 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
 	local_irq_disable();
 
 	/*
-	 * If the state flag indicates that the TLB will be flushed or if this
-	 * is the deepest c-state supported, do a voluntary leave mm to avoid
-	 * costly and mostly unnecessary wakeups for flushing the user TLB's
-	 * associated with the active mm.
+	 * leave_mm() to avoid costly and often unnecessary wakeups
+	 * for flushing the user TLB's associated with the active mm.
 	 */
-	if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED ||
-	    (&dev->states[dev->state_count - 1] == state))
+	if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED)
 		leave_mm(cpu);
 
 	if (!(lapic_timer_reliable_states & (1 << (cstate))))
-- 
1.7.3.2.90.gd4c43

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] intel_idle: delete bogus data from cpuidle_state.power_usage
  2010-10-26 21:07 ` [PATCH 1/5] intel_idle: simplify test for leave_mm() Len Brown
@ 2010-10-26 21:07   ` Len Brown
  2010-10-26 21:07   ` [PATCH 3/5] acpi_idle: " Len Brown
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Len Brown @ 2010-10-26 21:07 UTC (permalink / raw)
  To: linux-pm; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

The mW data in this field is a total fabrication
and serves no purpose other than to mislead
those who might see it in sysfs.  Delete it.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/idle/intel_idle.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index ad0fb01..8e35c89 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -101,7 +101,6 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x00,
 		.flags = CPUIDLE_FLAG_TIME_VALID,
 		.exit_latency = 3,
-		.power_usage = 1000,
 		.target_residency = 6,
 		.enter = &intel_idle },
 	{ /* MWAIT C2 */
@@ -110,7 +109,6 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x10,
 		.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 20,
-		.power_usage = 500,
 		.target_residency = 80,
 		.enter = &intel_idle },
 	{ /* MWAIT C3 */
@@ -119,7 +117,6 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x20,
 		.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 200,
-		.power_usage = 350,
 		.target_residency = 800,
 		.enter = &intel_idle },
 };
@@ -132,7 +129,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x00,
 		.flags = CPUIDLE_FLAG_TIME_VALID,
 		.exit_latency = 1,
-		.power_usage = 1000,
 		.target_residency = 4,
 		.enter = &intel_idle },
 	{ /* MWAIT C2 */
@@ -141,7 +137,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x10,
 		.flags = CPUIDLE_FLAG_TIME_VALID,
 		.exit_latency = 20,
-		.power_usage = 500,
 		.target_residency = 80,
 		.enter = &intel_idle },
 	{ /* MWAIT C3 */ },
@@ -151,7 +146,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x30,
 		.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 100,
-		.power_usage = 250,
 		.target_residency = 400,
 		.enter = &intel_idle },
 	{ /* MWAIT C5 */ },
@@ -161,7 +155,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.driver_data = (void *) 0x52,
 		.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 140,
-		.power_usage = 150,
 		.target_residency = 560,
 		.enter = &intel_idle },
 };
-- 
1.7.3.2.90.gd4c43

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] acpi_idle: delete bogus data from cpuidle_state.power_usage
  2010-10-26 21:07 ` [PATCH 1/5] intel_idle: simplify test for leave_mm() Len Brown
  2010-10-26 21:07   ` [PATCH 2/5] intel_idle: delete bogus data from cpuidle_state.power_usage Len Brown
@ 2010-10-26 21:07   ` Len Brown
  2010-10-26 21:07   ` [PATCH 4/5] intel_idle: add initial Sandy Bridge support Len Brown
  2010-10-26 21:07   ` [PATCH 5/5] intel_idle: do not use the LAPIC timer for ATOM C2 Len Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Len Brown @ 2010-10-26 21:07 UTC (permalink / raw)
  To: linux-pm; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

The mW data in this field comes from AML _CST,
which was typed in by a BIOS writer, and is thus
considered unreliable.

Linux does not use it for making any decisions.
We do display it in sysfs where somebody might
read it and assume it is meaningful, so delete it.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/processor_idle.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f4428e8..07a8bb6 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1013,7 +1013,6 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
 		strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
 		state->exit_latency = cx->latency;
 		state->target_residency = cx->latency * latency_factor;
-		state->power_usage = cx->power;
 
 		state->flags = 0;
 		switch (cx->type) {
-- 
1.7.3.2.90.gd4c43

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] intel_idle: add initial Sandy Bridge support
  2010-10-26 21:07 ` [PATCH 1/5] intel_idle: simplify test for leave_mm() Len Brown
  2010-10-26 21:07   ` [PATCH 2/5] intel_idle: delete bogus data from cpuidle_state.power_usage Len Brown
  2010-10-26 21:07   ` [PATCH 3/5] acpi_idle: " Len Brown
@ 2010-10-26 21:07   ` Len Brown
  2010-10-26 21:07   ` [PATCH 5/5] intel_idle: do not use the LAPIC timer for ATOM C2 Len Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Len Brown @ 2010-10-26 21:07 UTC (permalink / raw)
  To: linux-pm; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/idle/intel_idle.c |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 54f0fb4..84476be 100755
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -83,7 +83,7 @@ static unsigned int substates;
 static int (*choose_substate)(int);
 
 /* Reliable LAPIC Timer States, bit 1 for C1 etc.  */
-static unsigned int lapic_timer_reliable_states;
+static unsigned int lapic_timer_reliable_states = (1 << 1);	 /* Default to only C1 */
 
 static struct cpuidle_device *intel_idle_cpuidle_devices;
 static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state);
@@ -126,6 +126,42 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
 		.enter = &intel_idle },
 };
 
+static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "SNB-C1",
+		.desc = "MWAIT 0x00",
+		.driver_data = (void *) 0x00,
+		.flags = CPUIDLE_FLAG_TIME_VALID,
+		.exit_latency = 1,
+		.target_residency = 4,
+		.enter = &intel_idle },
+	{ /* MWAIT C2 */
+		.name = "SNB-C3",
+		.desc = "MWAIT 0x10",
+		.driver_data = (void *) 0x10,
+		.flags = CPUIDLE_FLAG_TIME_VALID,
+		.exit_latency = 80,
+		.target_residency = 160,
+		.enter = &intel_idle },
+	{ /* MWAIT C3 */
+		.name = "SNB-C6",
+		.desc = "MWAIT 0x20",
+		.driver_data = (void *) 0x20,
+		.flags = CPUIDLE_FLAG_TIME_VALID,
+		.exit_latency = 104,
+		.target_residency = 208,
+		.enter = &intel_idle },
+	{ /* MWAIT C4 */
+		.name = "SNB-C7",
+		.desc = "MWAIT 0x30",
+		.driver_data = (void *) 0x30,
+		.flags = CPUIDLE_FLAG_TIME_VALID,
+		.exit_latency = 109,
+		.target_residency = 300,
+		.enter = &intel_idle },
+};
+
 static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
@@ -312,6 +348,12 @@ static int intel_idle_probe(void)
 		cpuidle_state_table = atom_cstates;
 		choose_substate = choose_zero_substate;
 		break;
+
+	case 0x2A:	/* SNB */
+	case 0x2D:	/* SNB Xeon */
+		cpuidle_state_table = snb_cstates;
+		choose_substate = choose_zero_substate;
+		break;
 #ifdef FUTURE_USE
 	case 0x17:	/* 23 - Core 2 Duo */
 		lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
-- 
1.7.3.2.90.gd4c43

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] intel_idle: do not use the LAPIC timer for ATOM C2
  2010-10-26 21:07 ` [PATCH 1/5] intel_idle: simplify test for leave_mm() Len Brown
                     ` (2 preceding siblings ...)
  2010-10-26 21:07   ` [PATCH 4/5] intel_idle: add initial Sandy Bridge support Len Brown
@ 2010-10-26 21:07   ` Len Brown
  2010-11-02  1:21     ` Pavel Machek
  3 siblings, 1 reply; 7+ messages in thread
From: Len Brown @ 2010-10-26 21:07 UTC (permalink / raw)
  To: linux-pm; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

If we use the LAPIC timer during ATOM C2 on
some nvidia chisets, the system stalls.

https://bugzilla.kernel.org/show_bug.cgi?id=21032

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/idle/intel_idle.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index d310590..b68d594 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -302,7 +302,7 @@ static int intel_idle_probe(void)
 
 	case 0x1C:	/* 28 - Atom Processor */
 	case 0x26:	/* 38 - Lincroft Atom Processor */
-		lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
+		lapic_timer_reliable_states = (1 << 1); /* C1 */
 		cpuidle_state_table = atom_cstates;
 		break;
 
-- 
1.7.3.2.90.gd4c43

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 5/5] intel_idle: do not use the LAPIC timer for ATOM C2
  2010-10-26 21:07   ` [PATCH 5/5] intel_idle: do not use the LAPIC timer for ATOM C2 Len Brown
@ 2010-11-02  1:21     ` Pavel Machek
  0 siblings, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2010-11-02  1:21 UTC (permalink / raw)
  To: Len Brown; +Cc: Len Brown, linux-pm

On Tue 2010-10-26 17:07:34, Len Brown wrote:
> From: Len Brown <len.brown@intel.com>
> 
> If we use the LAPIC timer during ATOM C2 on
> some nvidia chisets, the system stalls.
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=21032

> @@ -302,7 +302,7 @@ static int intel_idle_probe(void)
>  
>  	case 0x1C:	/* 28 - Atom Processor */
>  	case 0x26:	/* 38 - Lincroft Atom Processor */
> -		lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
> +		lapic_timer_reliable_states = (1 << 1); /* C1 */
>  		cpuidle_state_table = atom_cstates;

That comment should probably go here, along with list of chipsets.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-02  1:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-26 21:07 idle patches for 2.6.37 Len Brown
2010-10-26 21:07 ` [PATCH 1/5] intel_idle: simplify test for leave_mm() Len Brown
2010-10-26 21:07   ` [PATCH 2/5] intel_idle: delete bogus data from cpuidle_state.power_usage Len Brown
2010-10-26 21:07   ` [PATCH 3/5] acpi_idle: " Len Brown
2010-10-26 21:07   ` [PATCH 4/5] intel_idle: add initial Sandy Bridge support Len Brown
2010-10-26 21:07   ` [PATCH 5/5] intel_idle: do not use the LAPIC timer for ATOM C2 Len Brown
2010-11-02  1:21     ` Pavel Machek

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.