public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Busy-wait delay in qmail 1.03 after upgrading to Linux 2.6
@ 2004-01-20  5:51 Peter Maas
  0 siblings, 0 replies; 16+ messages in thread
From: Peter Maas @ 2004-01-20  5:51 UTC (permalink / raw)
  To: linux-kernel

Re: Haakon Riiser
>I think I've been able to create a simple test program that
>demonstrates the bug I encountered with Qmail.

I've compiled and tested the code you posted, i thought that i would add
that renicing the LISTENER processes shows some interesting effects.

at nice 0 the writer spits out about 40 writes under .01 ms, then 3 to 5
writes at 97+ ms, after about 3 minutes its starts to get more random.
at nice -1 the writer spits out about 40 writes under .01 ms, then about 40
writes at 97+ ms, kept this cycle for over 10 minutes.
at nice 1 the writer spits out a few hundred writes under .01 ms, and
occasionally one at 97+ ms.

same effect if elevator=deadline

This thread caught my intrest because I run qmail on this box.

Peter Maas

Pentium II - 400MHz 128MB PC100
kernel-2.6.1-1.126 from http://people.redhat.com/arjanv/2.6/
(not subscribed - reads archives)


^ permalink raw reply	[flat|nested] 16+ messages in thread
* Busy-wait delay in qmail 1.03 after upgrading to Linux 2.6
@ 2004-01-13 21:09 Haakon Riiser
  2004-01-13 21:51 ` Andrew Morton
  0 siblings, 1 reply; 16+ messages in thread
From: Haakon Riiser @ 2004-01-13 21:09 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-01-20 19:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040120021353.39e9155e.akpm@osdl.org>
2004-01-20 18:33 ` Fw: Re: Busy-wait delay in qmail 1.03 after upgrading to Linux 2.6 Manfred Spraul
2004-01-20 19:22   ` Haakon Riiser
2004-01-20 19:45     ` Mike Fedyk
2004-01-20  5:51 Peter Maas
  -- strict thread matches above, loose matches on Subject: below --
2004-01-13 21:09 Haakon Riiser
2004-01-13 21:51 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox