Date: Sat, 8 Dec 2007 19:11:38 GMT From: Pasi Parviainen <pasi.parviainen@iki.fi> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/118497: [acpi][patch] Incorrectly determined device count in thermal zone monitoring thread. Message-ID: <200712081911.lB8JBcqH089567@www.freebsd.org> Resent-Message-ID: <200712081920.lB8JK1R2026309@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712081911.lB8JBcqH089567>