Date: Tue, 2 Aug 2005 00:35:48 +0200 From: Tijl Coosemans <tijl@ulyssis.org> To: freebsd-stable@freebsd.org Subject: Re: 5-STABLE cpufreq hotter than est from ports Message-ID: <200508020035.49097.tijl@ulyssis.org> In-Reply-To: <200508020022.02992.tijl@ulyssis.org> References: <200508020022.02992.tijl@ulyssis.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hmm, the server must have dropped the attachment. Another try...
[-- Attachment #2 --]
--- sys/kern/kern_cpu.c.orig Mon Aug 1 14:42:26 2005
+++ sys/kern/kern_cpu.c Mon Aug 1 23:52:06 2005
@@ -650,19 +650,7 @@
CF_MTX_ASSERT(&sc->lock);
- TAILQ_FOREACH(search, &sc->all_levels, link) {
- /* Skip this level if we've already modified it. */
- for (i = 0; i < search->rel_count; i++) {
- if (search->rel_set[i].dev == set_arr->sets[0].dev)
- break;
- }
- if (i != search->rel_count) {
- CF_DEBUG("skipping modified level, freq %d (dev %s)\n",
- search->total_set.freq,
- device_get_nameunit(search->rel_set[i].dev));
- continue;
- }
-
+ TAILQ_FOREACH_REVERSE(search, &sc->all_levels, cf_level_lst, link) {
/* Add each setting to the level, duplicating if necessary. */
for (i = 0; i < set_arr->count; i++) {
set = &set_arr->sets[i];
@@ -677,10 +665,11 @@
/*
* The new level was a duplicate of an existing level
- * so we freed it. Go to the next setting.
+ * or the relative setting was too low so we freed it.
+ * No need to try lower settings of this driver.
*/
if (fill == NULL)
- continue;
+ break;
/* Add this setting to the existing or new level. */
KASSERT(fill->rel_count < MAX_SETTINGS,
@@ -756,24 +745,28 @@
*/
list = &sc->all_levels;
if (TAILQ_EMPTY(list)) {
+ /* Does this ever happen? */
CF_DEBUG("dup done, inserted %d at head\n", fill_set->freq);
TAILQ_INSERT_HEAD(list, fill, link);
} else {
TAILQ_FOREACH_REVERSE(itr, list, cf_level_lst, link) {
itr_set = &itr->total_set;
- if (CPUFREQ_CMP(fill_set->freq, itr_set->freq)) {
- CF_DEBUG(
- "dup done, freeing new level %d, matches %d\n",
- fill_set->freq, itr_set->freq);
- free(fill, M_TEMP);
- fill = NULL;
- break;
- } else if (fill_set->freq < itr_set->freq) {
+ if (fill_set->freq > itr_set->freq) {
+ continue;
+ } else if (fill_set->freq < itr_set->freq &&
+ fill->abs_set.freq <= itr->abs_set.freq) {
CF_DEBUG(
"dup done, inserting new level %d after %d\n",
fill_set->freq, itr_set->freq);
TAILQ_INSERT_AFTER(list, itr, fill, link);
sc->all_count++;
+ break;
+ } else {
+ CF_DEBUG(
+ "dup done, freeing new level %d, worse than existing %d\n",
+ fill_set->freq, itr_set->freq);
+ free(fill, M_TEMP);
+ fill = NULL;
break;
}
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508020035.49097.tijl>
