public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Haakon Riiser <haakon.riiser@fys.uio.no>
To: linux-kernel@vger.kernel.org
Subject: Busy-wait delay in qmail 1.03 after upgrading to Linux 2.6
Date: Tue, 13 Jan 2004 22:09:23 +0100	[thread overview]
Message-ID: <20040113210923.GA955@s.chello.no> (raw)

When I first upgraded to Linux 2.6.0, I noticed that my mail
program (mutt) would occasionally stall when I send mails, even
when I send to a local account.

I investigated this further using the following strace command
(must be done as root) on qmail-inject:

  env - /usr/bin/strace -s1024 -tt -T -fF -o /tmp/st.out \
   /var/qmail/bin/qmail-inject </tmp/mail.test

/tmp/mail.test is this file:

  -----BEGIN-----
  From: hakonrk
  To: hakonrk
  Subject: hello

  world
  -----END-----

The entire output from strace is available for download from
<http://home.chello.no/~hakonrk/2.6.1.strace.out>, but I think
only this line is interesting:

  5083  16:00:30.714309 write(5, "\0", 1) = 1 <1.637019>

This the only write() to file descriptor 5 issued by qmail-queue,
right before it exists, and this is what causes the delay.
Notice that writing this single NUL-byte takes almost 1.64 seconds
(the number in the angle brackets at the end of the line is the
time spent in the system call, given by the -T flag to strace).
Furthermore, the kernel appears to be busy-waiting in this system
call, because the CPU usage quickly jumps to 100%.

Compare this to the result on Linux 2.4.24:
<http://home.chello.no/~hakonrk/2.4.24.strace.out>
Here's the same line that causes the delay on 2.6:

  5172  17:55:23.979799 write(5, "\0", 1) = 1 <0.000441>

Three orders of magnitude faster on 2.4!

I should also mention that the write-delay varies greatly.  I got
the above result (1.64 seconds) on a 2.6-system that had been
up for around four hours.  After rebooting, the delay dropped to
0.3 seconds, but it increases steadily while the system is up.

Finally, some info on my system:

  OS:      Slackware 9.1
  Kernels: 2.6.0, 2.6.1, 2.4.24
  Qmail:   1.03
  libc:    2.3.2
  gcc:     3.2.3
  CPU:     Athlon XP2500+

Kernel 2.6.1 was configured with
<http://home.chello.no/~hakonrk/config-2.6.1> 
and 2.4.24 with <http://home.chello.no/~hakonrk/config-2.4.24>.
If you need to know more, just ask.

If anyone on this list uses Qmail on Linux 2.6.x, I'd appreciate
it if you could do the strace test and see if you can reproduce
this bug.  Thanks in advance!

-- 
 Haakon

             reply	other threads:[~2004-01-13 21:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 21:09 Haakon Riiser [this message]
2004-01-13 21:51 ` Busy-wait delay in qmail 1.03 after upgrading to Linux 2.6 Andrew Morton
2004-01-13 23:26   ` Haakon Riiser
2004-01-13 23:43     ` Andrew Morton
2004-01-14  0:07       ` Haakon Riiser
2004-01-14 11:29         ` Haakon Riiser
2004-01-20  0:46           ` Haakon Riiser
2004-01-13 23:46     ` Haakon Riiser
2004-01-14  0:06       ` Andrew Morton
2004-01-14 10:27       ` Giuliano Pochini
2004-01-14 11:20         ` Haakon Riiser
2004-01-15  0:12         ` Haakon Riiser
  -- strict thread matches above, loose matches on Subject: below --
2004-01-20  5:51 Peter Maas
     [not found] <20040120021353.39e9155e.akpm@osdl.org>
2004-01-20 18:33 ` Fw: " Manfred Spraul
2004-01-20 19:22   ` Haakon Riiser
2004-01-20 19:45     ` Mike Fedyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040113210923.GA955@s.chello.no \
    --to=haakon.riiser@fys.uio.no \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox