public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@saeurebad.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Dave Jones <davej@codemonkey.org.uk>
Subject: Re: 2.6.24-rc5-git7: Reported regressions from 2.6.23
Date: Fri, 21 Dec 2007 14:52:17 +0100	[thread overview]
Message-ID: <87d4t05f5a.fsf@saeurebad.de> (raw)
In-Reply-To: <200712210212.02666.rjw@sisk.pl> (Rafael J. Wysocki's message of "Fri, 21 Dec 2007 02:12:02 +0100")

Hi,

"Rafael J. Wysocki" <rjw@sisk.pl> writes:

> This message contains a list of some regressions from 2.6.23 reported since
> 2.6.24-rc1 was released, for which there are no fixes in the mainline I know
> of.  If any of them have been fixed already, please let me know.
>
> If you know of any other unresolved regressions from 2.6.23, please let me know
> either and I'll add them to the list.  Also, please let me know if any of the
> entries below are invalid.

I still have a bug with cpufreq when using ondemand governor as default.

The performance governor, which has been the essential default until
1c2562459faedc35927546cfa5273ec6c2884cce,  was initialized with
fs_initcall() instead of module_init() to make sure the driver is up and
running when the bootcode (speedstep_init in my case) calls into it.

Since the above mentioned commit, other governors can also be chosen to
be the default but they are not correctly initialized before first use
then.

I poked Dave (added to CC) but no response since a few days.  I am
getting edgy now because this really breaks stuff and the attached patch
should get into .24 or at least the problem should be taken more
seriously.  I have not yet seen a discussion about this particular
problem, so if I missed something, please tell me and consider this mail
obsolete.

	Hannes


From: Johannes Weiner <hannes@saeurebad.de>
Date: Tue, 18 Dec 2007 13:03:49 +0100
Subject: [PATCH] cpufreq: Initialise default governor before use

When the cpufreq driver starts up at boot time, it calls into the
default governor which might not be initialised yet. This hurts when
the governor's worker function relies on memory that is not yet set up
by its init function.

This migrates all governors from module_init() to fs_initcall() when
being the default, as was already done in cpufreq_performance when it
was the only possible choice.

Fixes at least one actual oops where ondemand is the default governor
and cpufreq_governor_dbs() uses the uninitialised kondemand_wq
work-queue during boot-time.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---
 drivers/cpufreq/cpufreq_conservative.c |    4 ++++
 drivers/cpufreq/cpufreq_ondemand.c     |    5 ++++-
 drivers/cpufreq/cpufreq_performance.c  |    4 ++++
 drivers/cpufreq/cpufreq_userspace.c    |    4 ++++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 1bba997..5d3a04b 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -603,5 +603,9 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
 		"optimised for use in a battery environment");
 MODULE_LICENSE ("GPL");
 
+#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
+fs_initcall(cpufreq_gov_dbs_init);
+#else
 module_init(cpufreq_gov_dbs_init);
+#endif
 module_exit(cpufreq_gov_dbs_exit);
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 369f445..d2af20d 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -610,6 +610,9 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
                    "Low Latency Frequency Transition capable processors");
 MODULE_LICENSE("GPL");
 
+#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
+fs_initcall(cpufreq_gov_dbs_init);
+#else
 module_init(cpufreq_gov_dbs_init);
+#endif
 module_exit(cpufreq_gov_dbs_exit);
-
diff --git a/drivers/cpufreq/cpufreq_performance.c b/drivers/cpufreq/cpufreq_performance.c
index e8e1451..df5fca3 100644
--- a/drivers/cpufreq/cpufreq_performance.c
+++ b/drivers/cpufreq/cpufreq_performance.c
@@ -60,5 +60,9 @@ MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
 MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");
 MODULE_LICENSE("GPL");
 
+#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
 fs_initcall(cpufreq_gov_performance_init);
+#else
+module_init(cpufreq_gov_performance_init);
+#endif
 module_exit(cpufreq_gov_performance_exit);
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 51bedab..f8cdde4 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -231,5 +231,9 @@ MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>, Russell King <rmk@arm.linux.
 MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'");
 MODULE_LICENSE ("GPL");
 
+#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
 fs_initcall(cpufreq_gov_userspace_init);
+#else
+module_init(cpufreq_gov_userspace_init);
+#endif
 module_exit(cpufreq_gov_userspace_exit);
-- 
1.5.3.7


  reply	other threads:[~2007-12-21 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21  1:12 2.6.24-rc5-git7: Reported regressions from 2.6.23 Rafael J. Wysocki
2007-12-21 13:52 ` Johannes Weiner [this message]
2007-12-21 14:00   ` Michael Tokarev
2007-12-21 14:56     ` Johannes Weiner
2007-12-21 15:34   ` Johannes Weiner
2007-12-21 22:27   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d4t05f5a.fsf@saeurebad.de \
    --to=hannes@saeurebad.de \
    --cc=akpm@linux-foundation.org \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox