Re: powerd

From: Nate Lawson <nate_at_root.org>
Date: Wed, 07 Dec 2005 12:53:22 +0900
Dag-Erling Smørgrav wrote:
> des_at_des.no (Dag-Erling Smørgrav) writes:
> 
>>powerd is a mess, BTW.  I've tried to fix the most blatant mistakes
>>(poor understanding of signal handling), but it basically needs a
>>rewrite.

Thanks for the patch.  I'll review it later today and try to commit it.

> The signal handling code can probably be removed entirely.  Its only
> purpose is to catch SIGINT / SIGTERM so powerd can print some stats
> before exiting, but said stats are meaningless because:
> 
>  a) they assume that the main loop runs once every poll_interval, when
>     in fact the time between two successive iterations can range from
>     microseconds (interrupted usleep() / select()) to hours or even
>     days (suspended laptop).
 >
>  b) even assuming that a) does not apply and that ACPI provides
>     accurate values, it still only reports power consumed by the CPU,
>     not by peripherals or the LCD backlight.

Both a) and b) are not applicable.  The goal of those stats is to assist 
with profiling various algorithms.  You can compare the total power 
consumed over the same interval and workload for different algorithms to 
decide which is best.  Since the stats are only printed in verbose mode 
(and it doesn't daemonize in that mode), testers should know that 
suspending/resuming would cause the number to be inaccurate, it's only 
an estimate, and that it only pertains to CPU power.

I'll make sure the signal handling is cleaned up when I commit it.

-- 
Nate
Received on Wed Dec 07 2005 - 02:53:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:48 UTC