From owner-freebsd-stable@FreeBSD.ORG Mon Aug 1 22:36:02 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B47216A41F for ; Mon, 1 Aug 2005 22:36:02 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from outmx013.isp.belgacom.be (outmx013.isp.belgacom.be [195.238.3.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB2E943D46 for ; Mon, 1 Aug 2005 22:36:01 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from outmx013.isp.belgacom.be (localhost [127.0.0.1]) by outmx013.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j71MZqdI013713 for ; Tue, 2 Aug 2005 00:35:52 +0200 (envelope-from ) Received: from kalimero.kotnet.org (139-30.245.81.adsl.skynet.be [81.245.30.139]) by outmx013.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j71MZpvU013704 for ; Tue, 2 Aug 2005 00:35:51 +0200 (envelope-from ) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.13.3/8.13.3) with ESMTP id j71MZnI3001223 for ; Tue, 2 Aug 2005 00:35:49 +0200 (CEST) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: freebsd-stable@freebsd.org Date: Tue, 2 Aug 2005 00:35:48 +0200 User-Agent: KMail/1.8.1 References: <200508020022.02992.tijl@ulyssis.org> In-Reply-To: <200508020022.02992.tijl@ulyssis.org> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_FPq7Cv+OcA2s+h2" Message-Id: <200508020035.49097.tijl@ulyssis.org> Subject: Re: 5-STABLE cpufreq hotter than est from ports X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2005 22:36:02 -0000 --Boundary-00=_FPq7Cv+OcA2s+h2 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hmm, the server must have dropped the attachment. Another try... --Boundary-00=_FPq7Cv+OcA2s+h2 Content-Type: text/plain; charset="iso-8859-15"; name="patch-sys-kern-kern_cpu.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-sys-kern-kern_cpu.c" --- 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; } } --Boundary-00=_FPq7Cv+OcA2s+h2--