public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH 5/5] processor: jiffies-based bm_check, bugfixes
@ 2004-12-23 18:31 Pallipadi, Venkatesh
       [not found] ` <88056F38E9E48644A0F562A38C64FB6003A46B1D-exJ48ZlmiLpQxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Pallipadi, Venkatesh @ 2004-12-23 18:31 UTC (permalink / raw)
  To: Dominik Brodowski, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Brown, Len


We have another patch to fix this bm_activity history, by doing periodic
bm checks. I will post it here as soon as I rebase the patch with new
processor_idle.c.

Thanks,
Venki 

>-----Original Message-----
>From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org 
>[mailto:acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of 
>Dominik Brodowski
>Sent: Thursday, December 23, 2004 6:09 AM
>To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org; Brown, Len
>Subject: [ACPI] [PATCH 5/5] processor: jiffies-based bm_check, bugfixes
>
>Make the bm_activity depend on "jiffies", instead of numbers
>of the check being called. This means bus mastering activity
>is assumed if bm_check isn't called; and multiple calls during
>one jiffy will be |='ed.
>
>Also, two fixups where promotion and demotion were mixed up.
>
>Signed-off-by: Dominik Brodowski <linux-JhLEnvuH02M@public.gmane.org>
>---
>
> drivers/acpi/processor_idle.c |   19 ++++++++++++++++---
> include/acpi/processor.h      |    1 +
> 2 files changed, 17 insertions(+), 3 deletions(-)
>
>Index: linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_idle.c
>===================================================================
>--- 
>linux-2.6.10-rc3+bk-acpi.orig/drivers/acpi/processor_idle.c	
>2004-12-23 14:25:32.385908579 +0100
>+++ linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_idle.c	
>2004-12-23 14:39:58.360081349 +0100
>@@ -193,8 +193,18 @@
> 	 */
> 	if (pr->flags.bm_check) {
> 		u32		bm_status = 0;
>+		unsigned long	diff = jiffies - 
>pr->power.bm_check_timestamp;
> 
>-		pr->power.bm_activity <<= 1;
>+		if (diff > 32)
>+			diff = 32;
>+
>+		while (diff) {
>+			/* if we didn't get called, assume 
>there was busmaster activity */
>+			diff--;
>+			if (diff)
>+				pr->power.bm_activity |= 0x1;
>+			pr->power.bm_activity <<= 1;
>+		}
> 
> 		acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
> 			&bm_status, ACPI_MTX_DO_NOT_LOCK);
>@@ -213,6 +223,9 @@
> 				|| (inb_p(errata.piix4.bmisx + 
>0x0A) & 0x01))
> 				pr->power.bm_activity++;
> 		}
>+
>+		pr->power.bm_check_timestamp = jiffies;
>+
> 		/*
> 		 * Apply bus mastering demotion policy.  
>Automatically demote
> 		 * to avoid a faulty transition.  Note that the 
>processor
>@@ -439,13 +452,13 @@
> 
> 		if (higher) {
> 			cx->promotion.state  = higher;
>-			cx->demotion.threshold.ticks = 
>cx->latency_ticks;
>+			cx->promotion.threshold.ticks = 
>cx->latency_ticks;
> 			if (cx->type >= ACPI_STATE_C2)
> 				cx->promotion.threshold.count = 4;
> 			else
> 				cx->promotion.threshold.count = 10;
> 			if (higher->type == ACPI_STATE_C3)
>-				cx->demotion.threshold.bm = 0x0F;
>+				cx->promotion.threshold.bm = 0x0F;
> 		}
> 
> 		higher = cx;
>Index: linux-2.6.10-rc3+bk-acpi/include/acpi/processor.h
>===================================================================
>--- linux-2.6.10-rc3+bk-acpi.orig/include/acpi/processor.h	
>2004-12-23 13:21:12.000000000 +0100
>+++ linux-2.6.10-rc3+bk-acpi/include/acpi/processor.h	
>2004-12-23 14:41:47.558845116 +0100
>@@ -54,6 +54,7 @@
> 
> struct acpi_processor_power {
> 	struct acpi_processor_cx *state;
>+	unsigned long		bm_check_timestamp;
> 	u32			default_state;
> 	u32			bm_activity;
> 	int			count;
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from 
>real users.
>Discover which products truly live up to the hype. Start reading now. 
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Acpi-devel mailing list
>Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/acpi-devel
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 5/5] processor: jiffies-based bm_check, bugfixes
@ 2004-12-23 14:08 Dominik Brodowski
       [not found] ` <20041223140849.GE7973-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Dominik Brodowski @ 2004-12-23 14:08 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	len.brown-ral2JQCrhuEAvxtiuMwx3w

Make the bm_activity depend on "jiffies", instead of numbers
of the check being called. This means bus mastering activity
is assumed if bm_check isn't called; and multiple calls during
one jiffy will be |='ed.

Also, two fixups where promotion and demotion were mixed up.

Signed-off-by: Dominik Brodowski <linux-JhLEnvuH02M@public.gmane.org>
---

 drivers/acpi/processor_idle.c |   19 ++++++++++++++++---
 include/acpi/processor.h      |    1 +
 2 files changed, 17 insertions(+), 3 deletions(-)

Index: linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_idle.c
===================================================================
--- linux-2.6.10-rc3+bk-acpi.orig/drivers/acpi/processor_idle.c	2004-12-23 14:25:32.385908579 +0100
+++ linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_idle.c	2004-12-23 14:39:58.360081349 +0100
@@ -193,8 +193,18 @@
 	 */
 	if (pr->flags.bm_check) {
 		u32		bm_status = 0;
+		unsigned long	diff = jiffies - pr->power.bm_check_timestamp;
 
-		pr->power.bm_activity <<= 1;
+		if (diff > 32)
+			diff = 32;
+
+		while (diff) {
+			/* if we didn't get called, assume there was busmaster activity */
+			diff--;
+			if (diff)
+				pr->power.bm_activity |= 0x1;
+			pr->power.bm_activity <<= 1;
+		}
 
 		acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
 			&bm_status, ACPI_MTX_DO_NOT_LOCK);
@@ -213,6 +223,9 @@
 				|| (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
 				pr->power.bm_activity++;
 		}
+
+		pr->power.bm_check_timestamp = jiffies;
+
 		/*
 		 * Apply bus mastering demotion policy.  Automatically demote
 		 * to avoid a faulty transition.  Note that the processor
@@ -439,13 +452,13 @@
 
 		if (higher) {
 			cx->promotion.state  = higher;
-			cx->demotion.threshold.ticks = cx->latency_ticks;
+			cx->promotion.threshold.ticks = cx->latency_ticks;
 			if (cx->type >= ACPI_STATE_C2)
 				cx->promotion.threshold.count = 4;
 			else
 				cx->promotion.threshold.count = 10;
 			if (higher->type == ACPI_STATE_C3)
-				cx->demotion.threshold.bm = 0x0F;
+				cx->promotion.threshold.bm = 0x0F;
 		}
 
 		higher = cx;
Index: linux-2.6.10-rc3+bk-acpi/include/acpi/processor.h
===================================================================
--- linux-2.6.10-rc3+bk-acpi.orig/include/acpi/processor.h	2004-12-23 13:21:12.000000000 +0100
+++ linux-2.6.10-rc3+bk-acpi/include/acpi/processor.h	2004-12-23 14:41:47.558845116 +0100
@@ -54,6 +54,7 @@
 
 struct acpi_processor_power {
 	struct acpi_processor_cx *state;
+	unsigned long		bm_check_timestamp;
 	u32			default_state;
 	u32			bm_activity;
 	int			count;


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

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

end of thread, other threads:[~2004-12-24  9:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-23 18:31 [PATCH 5/5] processor: jiffies-based bm_check, bugfixes Pallipadi, Venkatesh
     [not found] ` <88056F38E9E48644A0F562A38C64FB6003A46B1D-exJ48ZlmiLpQxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-12-23 20:13   ` Dominik Brodowski
     [not found]     ` <20041223201334.GA19292-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-12-23 21:41       ` Venkatesh Pallipadi
     [not found]         ` <20041223134118.A24497-39QZ/XbsZ5/mO6KZMuUCQVaTQe2KTcn/@public.gmane.org>
2004-12-24  9:45           ` Dominik Brodowski
  -- strict thread matches above, loose matches on Subject: below --
2004-12-23 14:08 Dominik Brodowski
     [not found] ` <20041223140849.GE7973-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-12-23 20:11   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox