* [PATCH] cpufreq: allow ondemand governor as default
@ 2005-03-04 1:13 Rob Weryk
2005-03-06 17:06 ` Dominik Brodowski
0 siblings, 1 reply; 8+ messages in thread
From: Rob Weryk @ 2005-03-04 1:13 UTC (permalink / raw)
To: cpufreq
Hi,
The patch below (against 2.6.11) allows the ondemand cpufreq
governor to be selected as the default. If it's acceptable,
please apply.
(I'm not subscribed, so please cc me on replies, thanks.)
Signed-off-by: Rob Weryk <rjweryk@uwo.ca>
diff -ur linux-2.6.11/drivers/cpufreq/Kconfig robbie-2.6.11/drivers/cpufreq/Kconfig
--- linux-2.6.11/drivers/cpufreq/Kconfig 2005-03-02 14:08:42.000000000 -0500
+++ robbie-2.6.11/drivers/cpufreq/Kconfig 2005-03-02 14:29:28.000000000 -0500
@@ -69,6 +69,13 @@
program shall be able to set the CPU dynamically without having
to enable the userspace governor manually.
+config CPU_FREQ_DEFAULT_GOV_ONDEMAND
+ bool "ondemand"
+ select CPU_FREQ_GOV_ONDEMAND
+ help
+ Use the CPUFreq governor 'ondemand' as default. This dynamically
+ adjusts the CPU frequency based on the CPU use.
+
endchoice
config CPU_FREQ_GOV_PERFORMANCE
diff -ur linux-2.6.11/include/linux/cpufreq.h robbie-2.6.11/include/linux/cpufreq.h
--- linux-2.6.11/include/linux/cpufreq.h 2005-03-02 14:08:47.000000000 -0500
+++ robbie-2.6.11/include/linux/cpufreq.h 2005-03-02 14:21:52.000000000 -0500
@@ -264,6 +264,9 @@
#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE)
extern struct cpufreq_governor cpufreq_gov_userspace;
#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace
+#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND)
+extern struct cpufreq_governor cpufreq_gov_dbs;
+#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs
#endif
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-04 1:13 [PATCH] cpufreq: allow ondemand governor as default Rob Weryk
@ 2005-03-06 17:06 ` Dominik Brodowski
2005-03-06 21:51 ` Dave Jones
0 siblings, 1 reply; 8+ messages in thread
From: Dominik Brodowski @ 2005-03-06 17:06 UTC (permalink / raw)
To: Rob Weryk; +Cc: cpufreq
Hi,
This is not possible yet -- unfortunately. If you set ondemand to be
"default" but it fails at initialization (it does so for several drivers!),
cpufreq enters an undefined state.
Thanks,
Dominik
On Thu, Mar 03, 2005 at 08:13:59PM -0500, Rob Weryk wrote:
>
> Hi,
>
> The patch below (against 2.6.11) allows the ondemand cpufreq
> governor to be selected as the default. If it's acceptable,
> please apply.
>
> (I'm not subscribed, so please cc me on replies, thanks.)
>
> Signed-off-by: Rob Weryk <rjweryk@uwo.ca>
>
>
> diff -ur linux-2.6.11/drivers/cpufreq/Kconfig robbie-2.6.11/drivers/cpufreq/Kconfig
> --- linux-2.6.11/drivers/cpufreq/Kconfig 2005-03-02 14:08:42.000000000 -0500
> +++ robbie-2.6.11/drivers/cpufreq/Kconfig 2005-03-02 14:29:28.000000000 -0500
> @@ -69,6 +69,13 @@
> program shall be able to set the CPU dynamically without having
> to enable the userspace governor manually.
>
> +config CPU_FREQ_DEFAULT_GOV_ONDEMAND
> + bool "ondemand"
> + select CPU_FREQ_GOV_ONDEMAND
> + help
> + Use the CPUFreq governor 'ondemand' as default. This dynamically
> + adjusts the CPU frequency based on the CPU use.
> +
> endchoice
>
> config CPU_FREQ_GOV_PERFORMANCE
> diff -ur linux-2.6.11/include/linux/cpufreq.h robbie-2.6.11/include/linux/cpufreq.h
> --- linux-2.6.11/include/linux/cpufreq.h 2005-03-02 14:08:47.000000000 -0500
> +++ robbie-2.6.11/include/linux/cpufreq.h 2005-03-02 14:21:52.000000000 -0500
> @@ -264,6 +264,9 @@
> #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE)
> extern struct cpufreq_governor cpufreq_gov_userspace;
> #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace
> +#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND)
> +extern struct cpufreq_governor cpufreq_gov_dbs;
> +#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs
> #endif
>
>
> _______________________________________________
> Cpufreq mailing list
> Cpufreq@lists.linux.org.uk
> http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-06 17:06 ` Dominik Brodowski
@ 2005-03-06 21:51 ` Dave Jones
2005-03-06 23:02 ` Rob Weryk
2005-03-07 17:41 ` Bruno Ducrot
0 siblings, 2 replies; 8+ messages in thread
From: Dave Jones @ 2005-03-06 21:51 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: cpufreq, Rob Weryk
On Sun, Mar 06, 2005 at 06:06:25PM +0100, Dominik Brodowski wrote:
> This is not possible yet -- unfortunately. If you set ondemand to be
> "default" but it fails at initialization (it does so for several drivers!),
> cpufreq enters an undefined state
I knew there was a reason for declining this, but couldn't recall
what it was (hence I sent Rob to the list when he sent me the patch).
This has come up about 4-5 times now in the last month or two.
Maybe its worth adding a comment to the Kconfig to prevent a 6th time :-)
Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-06 21:51 ` Dave Jones
@ 2005-03-06 23:02 ` Rob Weryk
2005-03-07 17:41 ` Bruno Ducrot
1 sibling, 0 replies; 8+ messages in thread
From: Rob Weryk @ 2005-03-06 23:02 UTC (permalink / raw)
To: Dave Jones; +Cc: cpufreq, Dominik Brodowski
On Sun, Mar 06, 2005 at 04:51:06PM -0500, Dave Jones wrote:
> On Sun, Mar 06, 2005 at 06:06:25PM +0100, Dominik Brodowski wrote:
>
> > This is not possible yet -- unfortunately. If you set ondemand to be
> > "default" but it fails at initialization (it does so for several drivers!),
> > cpufreq enters an undefined state
>
> I knew there was a reason for declining this, but couldn't recall
> what it was (hence I sent Rob to the list when he sent me the patch).
Hi Dominik and Dave, thanks for letting me know.
> This has come up about 4-5 times now in the last month or two.
> Maybe its worth adding a comment to the Kconfig to prevent a 6th time :-)
How about the patch below? I initially tried to add it as a help
item, but those don't show up (at least not in make menuconfig)
Signed-off-by: Rob Weryk <rjweryk@uwo.ca>
--- linux-2.6.11/drivers/cpufreq/Kconfig 2005-03-06 17:25:06.000000000 -0500
+++ robbie-2.6.11/drivers/cpufreq/Kconfig 2005-03-06 17:58:55.000000000 -0500
@@ -52,6 +52,10 @@
This option sets which CPUFreq governor shall be loaded at
startup. If in doubt, select 'performance'.
+# Note that it is not currently possible to set the other governors
+# as the default, since if they fail to initialise, cpufreq will be
+# left in an undefined state.
+
config CPU_FREQ_DEFAULT_GOV_PERFORMANCE
bool "performance"
select CPU_FREQ_GOV_PERFORMANCE
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-06 21:51 ` Dave Jones
2005-03-06 23:02 ` Rob Weryk
@ 2005-03-07 17:41 ` Bruno Ducrot
2005-03-07 17:57 ` Dominik Brodowski
1 sibling, 1 reply; 8+ messages in thread
From: Bruno Ducrot @ 2005-03-07 17:41 UTC (permalink / raw)
To: Dave Jones; +Cc: Rob Weryk, cpufreq, Dominik Brodowski
On Sun, Mar 06, 2005 at 04:51:06PM -0500, Dave Jones wrote:
> On Sun, Mar 06, 2005 at 06:06:25PM +0100, Dominik Brodowski wrote:
>
> > This is not possible yet -- unfortunately. If you set ondemand to be
> > "default" but it fails at initialization (it does so for several drivers!),
> > cpufreq enters an undefined state
>
> I knew there was a reason for declining this, but couldn't recall
> what it was (hence I sent Rob to the list when he sent me the patch).
It refuse to load when latency for a state transition is too high (or unknown),
and if there is only ondemand as governor selected then kernel will likely fail at
boot time. It has been stated that its up to the low level drivers to
provide good information about latencies and therefore it is not
acceptable to accept to load ondemand if latency is unknown (but I don't
remember if its acceptable if latency is too high sorry ;)
And I dont remember what happens when the driver dont use the frequency
table helpers (geode) or is already capable for automaticaly
state switching (longrun).
> This has come up about 4-5 times now in the last month or two.
> Maybe its worth adding a comment to the Kconfig to prevent a 6th time :-)
Sure.
--
Bruno Ducrot
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-07 17:41 ` Bruno Ducrot
@ 2005-03-07 17:57 ` Dominik Brodowski
2005-03-08 9:40 ` Bruno Ducrot
0 siblings, 1 reply; 8+ messages in thread
From: Dominik Brodowski @ 2005-03-07 17:57 UTC (permalink / raw)
To: Bruno Ducrot; +Cc: Dave Jones, Rob Weryk, cpufreq
On Mon, Mar 07, 2005 at 06:41:50PM +0100, Bruno Ducrot wrote:
> And I dont remember what happens when the driver dont use the frequency
> table helpers (geode)
frequency table helpers do not enter the picture here; let me draw a
picture:
.-----------------. .-----------------------------.
| cpufreq core |-----------------| cpufreq ->target drivers |
|_________________| |_____________________________|
| |
| |
.-----------------. .-----------------------------------.
| governors | | frequency table helpers (optional)|
|_________________| |___________________________________|
> or is already capable for automaticaly state switching (longrun).
longrun or, in general, ->range() cpufreq drivers do not need governors at
all, so we do not need to take anything into account with regard to them.
Thanks,
Dominik
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-07 17:57 ` Dominik Brodowski
@ 2005-03-08 9:40 ` Bruno Ducrot
2005-03-08 17:37 ` Dominik Brodowski
0 siblings, 1 reply; 8+ messages in thread
From: Bruno Ducrot @ 2005-03-08 9:40 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: Dave Jones, Rob Weryk, cpufreq
Hi Dominik,
On Mon, Mar 07, 2005 at 06:57:19PM +0100, Dominik Brodowski wrote:
> On Mon, Mar 07, 2005 at 06:41:50PM +0100, Bruno Ducrot wrote:
> > And I dont remember what happens when the driver dont use the frequency
> > table helpers (geode)
>
> frequency table helpers do not enter the picture here; let me draw a
> picture:
>
> .-----------------. .-----------------------------.
> | cpufreq core |-----------------| cpufreq ->target drivers |
> |_________________| |_____________________________|
> | |
> | |
> .-----------------. .-----------------------------------.
> | governors | | frequency table helpers (optional)|
> |_________________| |___________________________________|
>
> > or is already capable for automaticaly state switching (longrun).
>
> longrun or, in general, ->range() cpufreq drivers do not need governors at
^^^^^
This was changed for ->setpolicy() ?
> all, so we do not need to take anything into account with regard to them.
>
Thanks for this clarification.
--
Bruno Ducrot
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cpufreq: allow ondemand governor as default
2005-03-08 9:40 ` Bruno Ducrot
@ 2005-03-08 17:37 ` Dominik Brodowski
0 siblings, 0 replies; 8+ messages in thread
From: Dominik Brodowski @ 2005-03-08 17:37 UTC (permalink / raw)
To: Bruno Ducrot; +Cc: Dave Jones, Rob Weryk, cpufreq
On Tue, Mar 08, 2005 at 10:40:05AM +0100, Bruno Ducrot wrote:
> Hi Dominik,
>
> On Mon, Mar 07, 2005 at 06:57:19PM +0100, Dominik Brodowski wrote:
> > On Mon, Mar 07, 2005 at 06:41:50PM +0100, Bruno Ducrot wrote:
> > > And I dont remember what happens when the driver dont use the frequency
> > > table helpers (geode)
> >
> > frequency table helpers do not enter the picture here; let me draw a
> > picture:
> >
> > .-----------------. .-----------------------------.
> > | cpufreq core |-----------------| cpufreq ->target drivers |
> > |_________________| |_____________________________|
> > | |
> > | |
> > .-----------------. .-----------------------------------.
> > | governors | | frequency table helpers (optional)|
> > |_________________| |___________________________________|
> >
> > > or is already capable for automaticaly state switching (longrun).
> >
> > longrun or, in general, ->range() cpufreq drivers do not need governors at
> ^^^^^
> This was changed for ->setpolicy() ?
not yet :) It's on my TODO list, though....
Dominik
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-03-08 17:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-04 1:13 [PATCH] cpufreq: allow ondemand governor as default Rob Weryk
2005-03-06 17:06 ` Dominik Brodowski
2005-03-06 21:51 ` Dave Jones
2005-03-06 23:02 ` Rob Weryk
2005-03-07 17:41 ` Bruno Ducrot
2005-03-07 17:57 ` Dominik Brodowski
2005-03-08 9:40 ` Bruno Ducrot
2005-03-08 17:37 ` Dominik Brodowski
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.