mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Add on-demand cpu-freq governor as default option
@ 2004-09-20  3:12 Con Kolivas
  2004-09-20 17:02 ` Dominik Brodowski
  0 siblings, 1 reply; 4+ messages in thread
From: Con Kolivas @ 2004-09-20  3:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, linux

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

This patch adds the option of using the on-demand cpu-frequency governor as 
the default governor in Kconfig.

Signed-off-by: Con Kolivas <kernel@kolivas.org>


[-- Attachment #2: ondemand_governor_default.diff --]
[-- Type: text/plain, Size: 1591 bytes --]

Index: linux-2.6.9-rc2-mm1/drivers/cpufreq/Kconfig
===================================================================
--- linux-2.6.9-rc2-mm1.orig/drivers/cpufreq/Kconfig	2004-09-19 19:49:57.716825544 +1000
+++ linux-2.6.9-rc2-mm1/drivers/cpufreq/Kconfig	2004-09-19 19:52:36.919623040 +1000
@@ -36,6 +36,17 @@ config CPU_FREQ_DEFAULT_GOV_USERSPACE
 	  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 governor does a periodic polling and 
+	  changes frequency based on the CPU utilization.
+	  The support for this governor depends on CPU capability to
+	  do fast frequency switching (i.e, very low latency frequency
+	  transitions). 
+
 endchoice
 
 config CPU_FREQ_GOV_PERFORMANCE
Index: linux-2.6.9-rc2-mm1/include/linux/cpufreq.h
===================================================================
--- linux-2.6.9-rc2-mm1.orig/include/linux/cpufreq.h	2004-09-19 19:49:57.765818096 +1000
+++ linux-2.6.9-rc2-mm1/include/linux/cpufreq.h	2004-09-19 19:52:36.919623040 +1000
@@ -323,6 +323,9 @@ extern struct cpufreq_governor cpufreq_g
 #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] 4+ messages in thread

* Re: [PATCH] Add on-demand cpu-freq governor as default option
  2004-09-20  3:12 [PATCH] Add on-demand cpu-freq governor as default option Con Kolivas
@ 2004-09-20 17:02 ` Dominik Brodowski
  2004-09-20 22:43   ` Con Kolivas
  0 siblings, 1 reply; 4+ messages in thread
From: Dominik Brodowski @ 2004-09-20 17:02 UTC (permalink / raw)
  To: Con Kolivas; +Cc: linux-kernel, akpm

I'm sorry, but this can't be done at the moment. The default cpufreq
governor needs to be one which can't fail to start up. And on-demand has
quite strict requirements on when it allows to be started and when it
doesn't.

	Dominik

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

* Re: Add on-demand cpu-freq governor as default option
  2004-09-20 17:02 ` Dominik Brodowski
@ 2004-09-20 22:43   ` Con Kolivas
  2004-09-21 16:16     ` Dominik Brodowski
  0 siblings, 1 reply; 4+ messages in thread
From: Con Kolivas @ 2004-09-20 22:43 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: Con Kolivas, linux-kernel, akpm

Dominik Brodowski writes:

> I'm sorry, but this can't be done at the moment. The default cpufreq
> governor needs to be one which can't fail to start up. And on-demand has
> quite strict requirements on when it allows to be started and when it
> doesn't.

Ah ok. Thanks. 

2 little questions please?

1. Would it be inappropriate to make it drop back to a different governor so 
that it can be selected?
2. Can cpu throttling be incorporated into this governor as well as a 
secondary mechanism for the lowest cpu frequency and as a primary 
mechanism for those cpus that don't support cpufreq?

Cheers,
Con


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

* Re: Add on-demand cpu-freq governor as default option
  2004-09-20 22:43   ` Con Kolivas
@ 2004-09-21 16:16     ` Dominik Brodowski
  0 siblings, 0 replies; 4+ messages in thread
From: Dominik Brodowski @ 2004-09-21 16:16 UTC (permalink / raw)
  To: Con Kolivas; +Cc: linux-kernel, akpm

Hi,

On Tue, Sep 21, 2004 at 08:43:09AM +1000, Con Kolivas wrote:
> 1. Would it be inappropriate to make it drop back to a different governor 
> so that it can be selected?

This would involve major changes to the cpufreq core, and it wouldn't make
it easier. I'll add it to my TODO list and think about it again once more
important issues are adressed. Agreed?

> 2. Can cpu throttling be incorporated into this governor as well as a 
> secondary mechanism for the lowest cpu frequency and as a primary 
> mechanism for those cpus that don't support cpufreq?

a) it hasn't to do anything with the _governor_. The governor works with
whatever method is offered to him, may it be frequency scaling or
throttling. Actually, some CPUfreq drivers actually only do throttling, and
you can use ondemand for them [if their latency values are set correctly,
that is].

b) on-demand throttling is useless. Throttling sets the CPU to the same
internal power state as the ACPI idle state C2 does [and C2 has quite the
same energy consumption as C1, actually...], so lowering the time spent
idling and increasing throttling doesn't save energy, while lowering idling
and increasing frequency scaling does save much energy. 

c) As throttling does make sense for thermal management and certain energy
consumption requirements [e.g. the battery isn't strong enough for the CPU
running at 100%], adapting the CPUfreq core to support loading one frequency
scaling and one frequency throttling driver at the same time is something I
have in my TODO list as well. Nonetheless, it will not be made available for
"on-demand" throttling, unless I'm convinced otherwise.

Thanks,
	Dominik

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

end of thread, other threads:[~2004-09-21 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-20  3:12 [PATCH] Add on-demand cpu-freq governor as default option Con Kolivas
2004-09-20 17:02 ` Dominik Brodowski
2004-09-20 22:43   ` Con Kolivas
2004-09-21 16:16     ` Dominik Brodowski

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

all inboxes | Powered by JetHome®