On Fri, 16 Jun 2006 17:53:12 +0200
Filippo Giunchedi <[EMAIL PROTECTED]> wrote:
> performance killer)
> Reply-To:
> X-Operating-System: Debian GNU/Linux 2.6.16.20
> X-Editor: VIM - Vi IMproved 7.0
> Organization: NoName Inc.
>
> tags 372760 + confirmed
> thanks
>
> Hi,
> I can reproduce and agree with this bug, on my system the CS count goes from
> ~700/s down to ~200/s with pbbuttonsd up/down
>
> Matthias: is there a reason to poll battery status so often? can it be
> decreased
> to a more sensible value or make it configurable?
You are right. There is no need for polling the battery files so often.
I split up the timer function and increased the low priority tasks to a one
second
polling interval. The changed version is in CVS (pbbuttons.cvs.sourceforge.net).
On my machine the effect is much lower than on yours. I used the same command
'dstat -cpyi --ipc 2 5' as Joerg to make the results comparable.
Without pbbuttons:
----total-cpu-usage---- ---procs--- ---system-- ----interrupts--- --sysv-ipc-
usr sys idl wai hiq siq|run blk new|_int_ _csw_|__47_ __48_ __57_|msg sem shm
8 1 90 1 0 0| 0 0 1| 130 654 | 2 60 5 | 1 1 18
5 0 87 7 0 0| 0 0 0| 75 301 | 0 60 2 | 1 1 18
3 0 97 0 0 0| 0 0 0| 74 283 | 0 61 0 | 1 1 18
4 0 97 0 0 0| 0 0 1| 73 283 | 0 60 0 | 1 1 18
3 0 97 0 0 0| 0 0 0| 74 266 | 0 61 0 | 1 1 18
4 0 92 4 0 0| 0 0 1| 88 274 | 0 60 0 | 1 1 18
With pbbuttons 0.7.5:
----total-cpu-usage---- ---procs--- ---system-- ----interrupts--- --sysv-ipc-
usr sys idl wai hiq siq|run blk new|_int_ _csw_|__47_ __48_ __57_|msg sem shm
8 1 90 1 0 0| 0 0 1| 130 653 | 2 60 5 | 2 1 18
7 0 88 5 0 0| 1 0 0| 94 428 | 0 61 0 | 2 1 18
3 0 96 0 0 0| 0 0 1| 104 444 | 0 60 11 | 2 1 18
4 0 97 0 0 0| 0 0 0| 105 435 | 0 61 11 | 2 1 18
3 0 96 0 0 0| 1 0 0| 92 417 | 0 60 0 | 2 1 18
3 0 96 0 0 0| 0 0 1| 87 430 | 0 61 1 | 2 1 18
This is the same cs increase as with gkrellm for instance (on my machine).
With the patched version (1 second interval, 10 times slower that 0.75):
----total-cpu-usage---- ---procs--- ---system-- ----interrupts--- --sysv-ipc-
usr sys idl wai hiq siq|run blk new|_int_ _csw_|__47_ __48_ __57_|msg sem shm
8 1 90 1 0 0| 0 0 1| 130 653 | 2 60 5 | 2 1 18
8 1 92 0 0 0| 0 0 0| 74 398 | 0 60 1 | 2 1 18
4 0 95 0 0 0| 0 0 1| 80 423 | 0 60 1 | 2 1 18
4 0 96 0 0 0| 0 0 0| 74 402 | 0 61 1 | 2 1 18
5 0 96 0 0 0| 0 0 1| 73 406 | 0 60 0 | 2 1 18
4 0 96 0 0 0| 0 0 0| 94 417 | 0 61 11 | 2 1 18
You see the difference is marginal on my machine.
Another test with increased 10ms cycle to 100ms:
----total-cpu-usage---- ---procs--- ---system-- ----interrupts--- --sysv-ipc-
usr sys idl wai hiq siq|run blk new|_int_ _csw_|__47_ __48_ __57_|msg sem shm
8 1 90 1 0 0| 0 0 1| 130 652 | 2 60 5 | 3 1 18
8 0 93 0 0 0| 0 0 0| 73 305 | 0 61 0 | 3 1 18
5 0 96 0 0 0| 0 0 1| 74 309 | 0 60 0 | 3 1 18
4 0 96 0 0 0| 0 0 0| 73 287 | 0 60 0 | 3 1 18
4 0 95 0 0 0| 0 0 1| 74 299 | 0 61 0 | 3 1 18
4 0 96 0 0 0| 0 0 0| 73 277 | 0 60 0 | 3 1 18
You see this is more effective, but has an impact on usability because pbbuttons
will react uncomfortable late on key events then. If you like to try it
yourself,
change in pbbuttonsd.c the line
timerid10 = g_timeout_add (10, cb_timer10, NULL);
to timerid10 = g_timeout_add (100, cb_timer10, NULL);
Best Regards
Matthias
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]