lkml.org 
[lkml]   [1999]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: PROBLEM: Sending mail-attachment > 45k with Netscape via sendmail hangs
mattes@ice.robin.de writes:

> I get real stalls, even with READ_SIZE of 500 I still get them.
> But I get the stalls only when serv lets the forked childprocs handle
> the connection. Without the fork() everything goes fine. Strange, huh?

Confirmed. Stock i686 v2.2.2 does this, while 2.2.1 does not. The
only difference which seemed to me like it could matter is the following
from patch-2.2.2.gz:

diff -u --recursive --new-file v2.2.1/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
--- v2.2.1/linux/net/ipv4/tcp_input.c Mon Jan 25 17:44:34 1999
+++ linux/net/ipv4/tcp_input.c Mon Feb 22 09:05:55 1999
@@ -130,11 +130,15 @@
{
tp->delayed_acks++;

- /* Tiny-grams with PSH set make us ACK quickly.
- * Note: This also clears the "quick ack mode" bit.
+ /* Tiny-grams with PSH set artifically deflate our
+ * ato measurement, but with a lower bound.
*/
- if(th->psh && (skb->len < (tp->mss_cache >> 1)))
- tp->ato = HZ/50;
+ if(th->psh && (skb->len < (tp->mss_cache >> 1))) {
+ /* Preserve the quickack state. */
+ if((tp->ato & 0x7fffffff) > HZ/50)
+ tp->ato = ((tp->ato & 0x80000000) |
+ (HZ/50));
+ }
}

/* Called to compute a smoothed rtt estimate. The data fed to this

We added this because people were noticing that 723 byte transfers took
200 ms longer than 724 byte transfers, but apparently it's introduced
a race condition for localhost TCP now.

If I run strace on the server (before it forks, then following onto the
child), the problem won't happen. Running strace on the client seems
not to matter. If I run a CPU-hog process for each CPU in my machine,
and renice the server down by 19, the pair do not hang either, and tcpdump
shows that the client window doesn't close.

Just to summarize the data:
- TCP to localhost hangs when the reader app consumes <= 956 bytes
- Slowing down the writer avoids the hang
- netstat output doesn't agree with tcpdump trace:
Proto Rcv Snd Local Address Foreign Address State
tcp 0 0 localhost:1025 localhost:3333 ESTABLISHED
tcp 0 39625 localhost:3333 localhost:1025 ESTABLISHED
- ps shows both client and server in do_select(), attaching with strace
shows the right sockets, which line up in /proc/*/fd and /proc/net/tcp
- It matters if the server forks or handles the client itself.
- stock 2.2.2, x86 machines
Feels like a race condition. Any ideas?

-- Pete
---------------------------------------------
Pete Wyckoff | wyckoff@ca.sandia.gov
Sandia National Labs | 925 294 3503 (voice)
MS 9011, P.O. Box 969 | 925 294 1225 (fax)
Livermore, CA 94551 |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.049 / U:23.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site