[lkml]   [1998]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: bug in 2.1.89 include/net/sock.h?
   Date: Sun, 22 Mar 1998 14:55:07 -0800 (PST)
From: Linus Torvalds <>

If ACK's etc frames take up resources, we _have_ to wake up,
because otherwise we can have cases where we never wake up when the
resources are free'd.

I determined that this was an impossible event, at least for TCP, but
for other reasons I agree that my suggested approach is a bad one.

Something like

/* Wake up only if we have more than half the wspace free: */
if (atomic_read(sk->wmem_alloc)*2 <= sk->sndbuf)) {
... wake_up() ..

should get rid of some unnecessary wake-ups, whether they are due
to ACK's or not. There's no point in having the writer trickle the
write data in small chunks anyway.

Sounds good. As Alexey mentioned, this was exactly what the code used
to do a long time ago, but the conditional disappeared early in the
2.1.x series.

Outside of the ACK cases, the other bogus case as I mentioned is for
clones of real outgoing data packets, used for transmission, the SOCK
gets charged again for the entire data area when in reality only
sizeof(struct sk_buff) more memory is being tied up due to the clone.

So the behavior observed is that if (for example) the outgoing
interface takes a little bit of time to transmit and free up the clone
it gets passed, a bulk call to tcp_do_sendmsg() will effectively only
allow the process to use half of sk->sndbuf for it's data if not less,
and this is because of the clone SKB issue I just mentioned.

David S. Miller

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to

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