Package: pbbuttonsd
Version: 0.7.5-1
Severity: normal

Hi,

at first some numbers:

#v+
% dstat -cpyi --ipc 2 5
----total-cpu-usage---- ---procs--- ---system-- ----interrupts--- --sysv-ipc-
usr sys idl wai hiq siq|run blk new|_int_ _csw_|__41_ __42_ __47_|msg sem shm
  5   1  93   0   0   0|  0   0   1|  73   422 |   1     9     3 |  1   0   4
  1   0  99   0   0   0|  1   0   0|  32    66 |   0     9     1 |  1   0   4
  1   0  97   0   1   0|  1   0   0| 177    93 |   0     9    16 |  1   0   4
  1   0  99   0   0   0|  1   0   0|  32    67 |   0     9     1 |  1   0   4
  1   0  99   0   0   0|  1   0   0|  32    67 |   0     9     1 |  1   0   4
  1   0  99   0   0   0|  1   0   0|  32    67 |   0     9     1 |  1   0   4

% invoke-rc.d pbbuttonsd start

% dstat -cpyi --ipc 2 5
----total-cpu-usage---- ---procs--- ---system-- ----interrupts--- --sysv-ipc-
usr sys idl wai hiq siq|run blk new|_int_ _csw_|__41_ __42_ __47_|msg sem shm
  5   1  93   0   0   0|  0   0   1|  73   422 |   1     9     3 |  2   0   4
  1   0  99   0   0   0|  1   0   0|  52   265 |   0     9     1 |  2   0   4
  1   0  99   0   0   0|  1   0   0|  59   267 |   0     9     1 |  2   0   4
  1   0  99   0   0   0|  1   0   0|  52   265 |   0     9     1 |  2   0   4
  1   0  99   0   0   0|  1   0   0|  52   264 |   0     9     1 |  2   0   4
  1   0  99   0   0   0|  1   0   0|  60   265 |   0     9     1 |  2   0   4
#v-

As you can see the rate of context switches grow dramatically after
starting pbbuttonsd. I ran ltrace on pbbuttonsd and found the following:

#v+
27289 14:42:09.441868 fopen("/proc/pmu/battery_0", "r")             = 0x10033948
27289 14:42:09.442145 fgets("\n", 805445632, 1024)                  = 0x7fece420
27289 14:42:09.442465 strtok("\n", ":\n")                           = NULL
27289 14:42:09.442596 fgets("flags      : 00000011\n", 805445655, 2) = 
0x7fece420
27289 14:42:09.442753 strtok("flags      : 00000011\n", ":\n")      = "flags    
  "
27289 14:42:09.442920 strncmp("flags", "flags      ", 5)            = 0
27289 14:42:09.443065 strtok(NULL, ":\n")                           = " 
00000011"
[…]
27289 14:42:09.450221 fgets(NULL, 0, 1024)                          = NULL
27289 14:42:09.450390 fclose(0x10033948)                            = 0
27289 14:42:09.450627 
sprintf("\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"...,
 NULL) = 19
27289 14:42:09.450811 fopen("/proc/pmu/battery_1", "r")             = 0
27289 14:42:09.451148 msgrcv(65536, 0x7fecc508, 8192, 0, 2048)      = -1
27289 14:42:09.451354 __errno_location()                            = 0x3001c0f0
27289 14:42:09.451487 __errno_location()                            = 0x3001c0f0
[…]
27289 14:42:09.541523 read(9, "", 32)                               = 2
27289 14:42:09.541672 
sprintf("\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"...,
 NULL) = 19
27289 14:42:09.541856 fopen("/proc/pmu/battery_0", "r")             = 0x10033948
27289 14:42:09.542099 fgets("\n", 805445632, 1024)                  = 0x7fece420
27289 14:42:09.542388 strtok("\n", ":\n")                           = NULL
#v-

The time between each access to /proc/pmu/battery_0 is really short –
100ms. The data in this files is not so often updated as you poll it.

I think on a laptop the rate of context switches should be low, because
each context switch consumes CPU cycles and this need power which is
precious on a mobile machine.

Bye, Jörg.

-- System Information:
Debian Release: unstable/experimental
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17-rc6
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages pbbuttonsd depends on:
ii  hdparm                        6.6-1      tune hard disk parameters for high
ii  libasound2                    1.0.11-7   ALSA library
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libgcc1                       1:4.1.1-2  GCC support library
ii  libglib2.0-0                  2.10.3-1   The GLib library of C routines
ii  libstdc++6                    4.1.1-2    The GNU Standard C++ Library v3
ii  lsb-base                      3.1-10     Linux Standard Base 3.1 init scrip
ii  makedev                       2.3.1-81   creates device files in /dev
ii  udev                          0.093-1    /dev/ and hotplug management daemo

Versions of packages pbbuttonsd recommends:
pn  laptop-mode-tools             <none>     (no description available)

-- no debconf information

Attachment: pgpzdWIixvkN8.pgp
Description: PGP signature

Reply via email to