From owner-freebsd-bugs@FreeBSD.ORG Sat Dec 8 19:20:01 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB83E16A419 for ; Sat, 8 Dec 2007 19:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9A45B13C459 for ; Sat, 8 Dec 2007 19:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lB8JK1rw026310 for ; Sat, 8 Dec 2007 19:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lB8JK1R2026309; Sat, 8 Dec 2007 19:20:01 GMT (envelope-from gnats) Resent-Date: Sat, 8 Dec 2007 19:20:01 GMT Resent-Message-Id: <200712081920.lB8JK1R2026309@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pasi Parviainen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 028A816A418 for ; Sat, 8 Dec 2007 19:11:48 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E71A213C448 for ; Sat, 8 Dec 2007 19:11:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lB8JBcHI089568 for ; Sat, 8 Dec 2007 19:11:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id lB8JBcqH089567; Sat, 8 Dec 2007 19:11:38 GMT (envelope-from nobody) Message-Id: <200712081911.lB8JBcqH089567@www.freebsd.org> Date: Sat, 8 Dec 2007 19:11:38 GMT From: Pasi Parviainen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/118497: [acpi][patch] Incorrectly determined device count in thermal zone monitoring thread. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2007 19:20:01 -0000 >Number: 118497 >Category: kern >Synopsis: [acpi][patch] Incorrectly determined device count in thermal zone monitoring thread. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 08 19:20:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Pasi Parviainen >Release: 8.0-CURRENT >Organization: >Environment: FreeBSD localhost 8.0-CURRENT FreeBSD 8.0-CURRENT #10: Fri Nov 30 00:22:44 EET 2007 root@localhost:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Following was observed on HP 6510b laptop. For every iteration of main loop in thermal zone monitoring thread (acpi_tz_thread), there is unnecessary memory free and allocation cycle. This is caused by use of devclass_get_maxunit to determine number of devices which is different value than number of devices returned by devclass_get_devices. In observed system these values are 6 and 5 respectively (always). >How-To-Repeat: >Fix: Replace devclass_get_maxunit with devclass_get_count to determine number of devices which corresponds to value returned by devclass_get_devices. Patch attached with submission follows: --- sys/dev/acpica/acpi_thermal.c 2007-10-21 02:23:13.000000000 +0300 +++ sys/dev/acpica/acpi_thermal.c 2007-12-08 19:57:37.000000000 +0200 @@ -874,7 +874,7 @@ for (;;) { /* If the number of devices has changed, re-evaluate. */ - if (devclass_get_maxunit(acpi_tz_devclass) != devcount) { + if (devclass_get_count(acpi_tz_devclass) != devcount) { if (devs != NULL) { free(devs, M_TEMP); free(sc, M_TEMP); >Release-Note: >Audit-Trail: >Unformatted: