All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor
@ 2005-02-06 22:33 Eric Piel
  2005-02-09 19:15 ` Dominik Brodowski
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Piel @ 2005-02-06 22:33 UTC (permalink / raw)
  To: Venkatesh Pallipadi, Jun Nakajima; +Cc: cpufreq

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

Hello,

For now the ondemand governor doesn't support the drivers which reports 
a transition latency of CPUFREQ_ETERNAL. That's really a problem because 
most of the drivers declare such a latency (simply because it's not 
known, not really because the transition will take an eternal time). 
All userspace daemons suport those drivers, they just don't pay 
attention to the transition latency.

This patch proposes to consider a CPUFREQ_ETERNAL latency as the maximum 
possible latency of the governor (10 ms). I think this should be 
conservative enough to be safe with any driver.

Hoping you like it,
Eric

--
Support for CPUFREQ_ETERNAL drivers by the ondemand governor.

Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
--

[-- Attachment #2: ondemand-accept-eternel-transition-latency-2.6.11-rc3.patch --]
[-- Type: text/x-patch, Size: 1345 bytes --]

--- linux-2.6.11-rc3/drivers/cpufreq/cpufreq_ondemand.c.orig	2005-02-05 17:09:30.000000000 +0100
+++ linux-2.6.11-rc3/drivers/cpufreq/cpufreq_ondemand.c	2005-02-05 18:02:55.000000000 +0100
@@ -56,7 +56,7 @@ static unsigned int 				def_sampling_rat
 #define MAX_SAMPLING_RATE			(500 * def_sampling_rate)
 #define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER	(1000)
 #define DEF_SAMPLING_DOWN_FACTOR		(10)
-#define TRANSITION_LATENCY_LIMIT		(10 * 1000)
+#define TRANSITION_LATENCY_LIMIT		(10 * 1000 * 1000) /* ns */
 #define sampling_rate_in_HZ(x)			(((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))
 
 static void do_dbs_timer(void *data);
@@ -385,8 +385,8 @@ static int cpufreq_governor_dbs(struct c
 		    (!policy->cur))
 			return -EINVAL;
 
-		if (policy->cpuinfo.transition_latency >
-				(TRANSITION_LATENCY_LIMIT * 1000))
+		if ((policy->cpuinfo.transition_latency > TRANSITION_LATENCY_LIMIT) &&
+		    (policy->cpuinfo.transition_latency != CPUFREQ_ETERNAL))
 			return -EINVAL;
 		if (this_dbs_info->enable) /* Already enabled */
 			break;
@@ -416,6 +416,8 @@ static int cpufreq_governor_dbs(struct c
 			/* policy latency is in nS. Convert it to uS first */
 
 			latency = policy->cpuinfo.transition_latency;
+			if (latency == CPUFREQ_ETERNAL)
+				latency = TRANSITION_LATENCY_LIMIT;
 			if (latency < 1000)
 				latency = 1000;
 

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor
@ 2005-02-07 18:29 Pallipadi, Venkatesh
  0 siblings, 0 replies; 5+ messages in thread
From: Pallipadi, Venkatesh @ 2005-02-07 18:29 UTC (permalink / raw)
  To: Eric Piel, Nakajima, Jun; +Cc: cpufreq


Hi,

The ondemand governor uses the transitions latency information 
to set a proper default sampling rate. 
For example, if the transitions latency is 100uS, the default 
sampling rate used by ondemand governor is 100 mS. So, wrong 
assumption about the transition latency can lead to frequent 
sampling and overhead in the kernel. Transition Latency doesn't 
matter a lot for userspace governors as their sampling rate is 
typically much less (few seconds).

I agree that changing CPUFREQ_ETERNAL to 10mS would be safe with 
most of the governors and this change would enable such governors 
to work with ondemand. But, making this assumption inside 
the ondemand governor makes me little nervous. What if some 
particular driver has latency more than 10mS (there may not be 
any such driver today. But, some new driver can come up in future). 

I feel better way to workarond this issue is to have one more 
intermediate #define, say CPUFREQ_LATENCY_LESS_THAN_1MS defined 
to 1MS and use it in place of CPUFREQ_ETERNAL in all the drivers 
that know their transition latency is less than this value and  
don't know their exact transition latency.

Thanks,
Venki

>-----Original Message-----
>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net] 
>Sent: Sunday, February 06, 2005 2:34 PM
>To: Pallipadi, Venkatesh; Nakajima, Jun
>Cc: cpufreq@ZenII.linux.org.uk
>Subject: [PATCH] support for CPUFREQ_ETERNAL drivers by the 
>ondemand governor
>
>Hello,
>
>For now the ondemand governor doesn't support the drivers 
>which reports 
>a transition latency of CPUFREQ_ETERNAL. That's really a 
>problem because 
>most of the drivers declare such a latency (simply because it's not 
>known, not really because the transition will take an eternal time). 
>All userspace daemons suport those drivers, they just don't pay 
>attention to the transition latency.
>
>This patch proposes to consider a CPUFREQ_ETERNAL latency as 
>the maximum 
>possible latency of the governor (10 ms). I think this should be 
>conservative enough to be safe with any driver.
>
>Hoping you like it,
>Eric
>
>--
>Support for CPUFREQ_ETERNAL drivers by the ondemand governor.
>
>Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
>--
>

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

end of thread, other threads:[~2005-09-19 22:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-06 22:33 [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor Eric Piel
2005-02-09 19:15 ` Dominik Brodowski
2005-03-06 17:06   ` [PATCH] transition latency of speedstep-ich Eric Piel
     [not found]     ` <20050307182137.GB24559@isilmar.linta.de>
     [not found]       ` <432DD8DD.3090805@tremplin-utc.net>
     [not found]         ` <20050919101843.GA13041@isilmar.linta.de>
2005-09-19 22:35           ` [PATCH] transition latency of speedstep-ich (third try) Eric Piel
  -- strict thread matches above, loose matches on Subject: below --
2005-02-07 18:29 [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor Pallipadi, Venkatesh

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.