[Goodies-commits] r5354 - xfce4-battery-plugin/trunk/panel-plugin

Auke Kok sofar at xfce.org
Thu Sep 4 20:41:04 CEST 2008


Author: sofar
Date: 2008-09-04 18:41:04 +0000 (Thu, 04 Sep 2008)
New Revision: 5354

Modified:
   xfce4-battery-plugin/trunk/panel-plugin/battery.c
Log:
Fix bugzilla #3339 - battery plugin causes excessive ACPI interrupts.

The plugin polled ACPI every 2 seconds. Since the polling method involved
reading 4-5 /proc/acpi files, we get about 5 ACPI interrupts for each
battery read loop. This results in 5 irq's per second.

Updating every 30 seconds should be more than enough warning for everyone :)


Modified: xfce4-battery-plugin/trunk/panel-plugin/battery.c
===================================================================
--- xfce4-battery-plugin/trunk/panel-plugin/battery.c	2008-09-04 18:35:32 UTC (rev 5353)
+++ xfce4-battery-plugin/trunk/panel-plugin/battery.c	2008-09-04 18:41:04 UTC (rev 5354)
@@ -333,7 +333,11 @@
     /* Show initial state if using ACPI rather than waiting a minute */
     if(battmon->flag) {
         g_source_remove(battmon->timeoutid);
-        battmon->timeoutid = g_timeout_add(2 * 1024,
+        /* we hit ACPI 4-5 times per poll, so polling every 2 seconds
+	 * generates ~10 interrupts per second. updating every 30 seconds
+	 * should be more than enough, and comes down to only 0.16
+	 * interrupts per second, adding significant sleep time */
+        battmon->timeoutid = g_timeout_add(30 * 1024,
                 (GSourceFunc) update_apm_status, battmon);
     }
 




More information about the Goodies-commits mailing list