From: Eric Dumazet <dada1@cosmosbay.com> Date: Fri, 09 Jan 2009 07:47:16 +0100Spice read does not handle SO_RCVLOWAT like tcp_recvmsg() does. We should probably add a: target = sock_rcvlowat(sk, flags & MSG_WAITALL, len); and check 'target' against 'spliced' in the main loop of tcp_splice_read(). I sometimes have a suspicion we can remove this test too, but it's not really that clear. If an application is doing non-blocking reads and they care about latency, they shouldn't be providing huge buffers. This much I agree with, but... If you look at where this check is placed in the recvmsg() case, it is done after we have verified that there is no socket backlog. if (copied >= target && !sk->sk_backlog.tail) break; if (copied) { if (sk->sk_err || sk->sk_state == TCP_CLOSE || (sk->sk_shutdown & RCV_SHUTDOWN) || !timeo || signal_pending(current)) break; } else { So either: 1) We haven't met the target. And note that target is one unless the user makes an explicit receive low-water setting. 2) Or there is no backlog. When we get to the 'if (copied)' check. You can view this "!timeo" check as meaning "non-blocking". When we get to it, we are guarenteed that we haven't met the target and we have no backlog. So it is absolutely appropriate to break out of recvmsg() processing here if non-blocking. There is a lot of logic and feature handling in tcp_splice_read() and that's why the semantics of "!timeo" cases are not being handled properly here. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Linus Torvalds | Linux 2.6.21 |
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Con Kolivas | Re: [PATCH][RSDL-mm 0/7] RSDL cpu scheduler for 2.6.21-rc3-mm2 |
| Andrew Morton | echo mem > /sys/power/state |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [GIT]: Networking |
| Michael S. Tsirkin | Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure |
