Package: at
Version: 3.1.10
Severity: normal

Hello,

When I queue a job with 'batch', atd uses about 60% of the CPU:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2290 daemon    39  19  1956  468  396 R 59.4  0.1  49:26.18 atd
29963 frederik  35  19 20276 6068 1740 D 21.9  1.2   0:53.27 mencoder

Running 'strace -p 2290' shows that the same system calls are being
repeated over and over again, many times per second:

----------------------------------------------------------------
stat64(".", {st_mode=S_IFDIR|S_ISVTX|0770, st_size=4096, ...}) = 0
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4
fstat64(4, {st_mode=S_IFDIR|S_ISVTX|0770, st_size=4096, ...}) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
getdents(4, /* 4 entries */, 4096)      = 76
stat64("b0002e012f3736", {st_mode=S_IFREG|0700, st_size=5697, ...}) = 0
getdents(4, /* 0 entries */, 4096)      = 0
close(4)                                = 0
open("/proc/loadavg", O_RDONLY)         = 4
read(4, "3.52 3.19 3.09 3/252 29879\n", 64) = 27
close(4)                                = 0
time(NULL)                              = 1192296108
stat64(".", {st_mode=S_IFDIR|S_ISVTX|0770, st_size=4096, ...}) = 0
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4
fstat64(4, {st_mode=S_IFDIR|S_ISVTX|0770, st_size=4096, ...}) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
getdents(4, /* 4 entries */, 4096)      = 76
stat64("b0002e012f3736", {st_mode=S_IFREG|0700, st_size=5697, ...}) = 0
getdents(4, /* 0 entries */, 4096)      = 0
close(4)                                = 0
open("/proc/loadavg", O_RDONLY)         = 4
read(4, "3.52 3.19 3.09 2/252 29879\n", 64) = 27
close(4)                                = 0
time(NULL)                              = 1192296108
----------------------------------------------------------------

It seems that 'atd' is in a busy loop reading '/proc/loadavg',
apparently faster than the kernel can update it. This behaviour makes
'batch' quite inefficient. Am I doing something wrong?

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

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

Versions of packages at depends on:
ii  exim4-daemon-light [mail-tran 4.67-8     lightweight Exim MTA (v4) daemon
ii  libc6                         2.6.1-5    GNU C Library: Shared libraries
ii  libpam0g                      0.99.7.1-5 Pluggable Authentication Modules l
ii  lsb-base                      3.1-24     Linux Standard Base 3.1 init scrip

at recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to