From: Eric Dumazet
Date: Fri, 09 Jan 2009 07:47:16 +0100> I found this patch usefull in my testings, but had a feeling something
Spice 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().
> About tcp_recvmsg(), we might also remove the "!timeo" test as well,
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
| Alan Cox | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Bart Van Assche | Re: Integration of SCST in the mainstream Linux kernel |
| Andrew Morton | Re: [RFC/PATCH] Documentation of kernel messages |
git: | |
| Winkler, Tomas | RE: iwlwifi: fix build bug in "iwlwifi: fix LED stall" |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Mark Lord | Re: [BUG] New Kernel Bugs |
