Subject: Re: sysmon uses more power
To: Juan RP <juan@xtrarom.org>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 09/27/2007 18:38:47
On Tue, 25 Sep 2007, Iain Hibbert wrote:

> On Tue, 25 Sep 2007, Juan RP wrote:
>
> > If you increased kern.envsys.refresh_timeout and you are still seeing
> > that smtaskq is using a lot of cpu time, I dunno.
>
> I'm investigating more, though its complex and too many distractions today :)

FWIW I don't think its the envsys part munching CPU directly, if I add the
following:

--- /usr/src/sys/dev/sysmon/sysmon_envsys.c	2007-09-05 22:23:39.000000000 +0100
+++ sysmon_envsys.c	2007-09-26 10:18:01.000000000 +0100
@@ -916,6 +916,8 @@
 		sme_evdrv_t->sme = sme;
 		sme_evdrv_t->powertype = sdt_units[i].crittype;

+		printf("%s: monitor %s\n", __func__, edata->desc);
+
 		sysmon_task_queue_init();
 		sysmon_task_queue_sched(0, sme_event_drvadd, sme_evdrv_t);
 	}

then I get the following at bootup:

Sep 27 18:24:39 galant /netbsd: sme_add_sensor_dictionary: monitor charge state
Sep 27 18:24:39 galant /netbsd: sme_add_sensor_dictionary: monitor charge state
Sep 27 18:24:39 galant /netbsd: sme_add_sensor_dictionary: monitor temperature

and its never scheduled again (presumably because I got no powerd running)

the acpi code schedules callbacks on the sysmon task queue fairly
regularly (about 100 times per minute) via AcpiOsQueueForExecution but I
haven't worked out if any particular one is working harder than it
should..

iain