kern/118497: [acpi][patch] Incorrectly determined device count in thermal zone monitoring thread.

Pasi Parviainen pasi.parviainen at iki.fi
Sat Dec 8 11:20:01 PST 2007


>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 at 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:


More information about the freebsd-bugs mailing list