Package: pppstatus
Version: 0.4.2-9
Severity: normal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When upgrading my debian box from kernel 2.6.18-4-k7 to 2.6.21-2-k7, pppstatus
starts (when the system is connected to the internet) eating up more than 50% of
CPU (top display), increasing the load remarkeably and slowing down the system
to an annoying extent.

I think the underlying problem is the 'usleep (10L);' call in pppstatus.c,
l.2087: kernel 2.6.21 seems to meet the sleep time of only 10 microseconds (!)
much closer that kernel 2.6.18.  Thus the pppstatus processing loop runs almost
without any pause, eating up the whole CPU time it gets.

The attached minimal C program demonstrates the usleep differences between both
kernels, the attached outputs result from running it ten times on my box.

When patching the usleep call to 10.000 microsends, CPU usage decreases to the
used level and my box becomes fluently usable again.

- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-k7 (SMP w/1 CPU core)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pppstatus depends on:
ii  libc6                     2.6-2          GNU C Library: Shared libraries
ii  libncurses5               5.6+20070716-1 Shared libraries for terminal hand

pppstatus recommends no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGtc7Bco2LfriI0s4RAq64AKCwaw62k4BTdF2fxLU0rDQdsRLTmgCgpbRv
CewxqgQCoKbEckodByVX5RE=
=oGY3
-----END PGP SIGNATURE-----
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>

int main(int argc, char **argv)
{
    struct timeval  startTime;
    struct timeval  endTime;
    struct timezone timeZone;

    gettimeofday(&startTime, &timeZone);
    usleep(10L);
    gettimeofday(&endTime, &timeZone);
    printf("Elapsed time: %li seconds, %li microseconds.\n",
           endTime.tv_sec - startTime.tv_sec,
           endTime.tv_usec - startTime.tv_usec);
    return 0;
}
for in in `seq 10`; do ./test_usleep; done
Elapsed time: 0 seconds, 4734 microseconds.
Elapsed time: 0 seconds, 6521 microseconds.
Elapsed time: 0 seconds, 3306 microseconds.
Elapsed time: 0 seconds, 6018 microseconds.
Elapsed time: 0 seconds, 2792 microseconds.
Elapsed time: 0 seconds, 2751 microseconds.
Elapsed time: 0 seconds, 2768 microseconds.
Elapsed time: 0 seconds, 2765 microseconds.
Elapsed time: 0 seconds, 2785 microseconds.
Elapsed time: 0 seconds, 2748 microseconds.
for in in `seq 10`; do ./test_usleep; done
Elapsed time: 0 seconds, 152 microseconds.
Elapsed time: 0 seconds, 107 microseconds.
Elapsed time: 0 seconds, 103 microseconds.
Elapsed time: 0 seconds, 94 microseconds.
Elapsed time: 0 seconds, 103 microseconds.
Elapsed time: 0 seconds, 100 microseconds.
Elapsed time: 0 seconds, 44 microseconds.
Elapsed time: 0 seconds, 106 microseconds.
Elapsed time: 0 seconds, 105 microseconds.
Elapsed time: 0 seconds, 99 microseconds.

Reply via email to