lkml.org 
[lkml]   [1996]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectLinus's tcp.c patch
Enough people have asked me about Linus's tcp.c patch (to correct the
problem of hung httpd's) that I'm forwarding it back to the linux-kernel
list and a few others where people might need it.

On the system that was encountering this problem almost daily (sometimes
twice daily) I'm up to about 8.5 days without a recurrence.

---------------------------------------------------------------------
> This should cause httpd children to die after they've used 6 minutes of
> CPU time. The below should therefore not be happening:
>
> USER PID %CPU %MEM SIZE RSS TTY STAT START TIME COMMAND
> nobody 26962 59.7 0.4 1144 472 ? R 18:49 22:49 ./httpd-1.1.1-limit

The patch below should fix it, and while it is done against 2.0.22 it should
actually apply to just about any reasonably recent kernel.

Linus

---
diff -u --recursive v2.0.22/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.0.22/linux/net/ipv4/tcp.c Tue Oct 8 21:20:15 1996
+++ linux/net/ipv4/tcp.c Wed Oct 9 18:28:34 1996
@@ -873,6 +873,8 @@
sk->socket->flags &= ~SO_NOSPACE;
add_wait_queue(sk->sleep, &wait);
for (;;) {
+ if (current->signal & ~current->blocked)
+ break;
current->state = TASK_INTERRUPTIBLE;
if (tcp_memory_free(sk))
break;
-----
------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Unsolicited commercial e-mail will
Network Administrator | be proof-read for $199/hr.
________Finger jlewis@inorganic5.fdt.net for PGP public key_______

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