Thread (15 messages) flat view 15 messages, 4 authors, 2009-05-21

Re: [PATCH] net: reduce number of reference taken on sk_refcnt

From: David Miller <davem@davemloft.net>
Date: 2009-05-19 04:58:25

From: Eric Dumazet <redacted>
Date: Sun, 10 May 2009 12:45:56 +0200
Patch follows for RFC only (not Signed-of...), and based on net-next-2.6 
Thanks for the analysis.
quoted hunk ↗ jump to hunk
@@ -922,10 +922,13 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
 	} else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
 		wake_up_interruptible_poll(sk->sk_sleep,
 					   POLLIN | POLLRDNORM | POLLRDBAND);
-		if (!inet_csk_ack_scheduled(sk))
+		if (!inet_csk_ack_scheduled(sk)) {
+			unsigned int delay = (3 * tcp_rto_min(sk)) / 4;
+
+			delay = min(inet_csk(sk)->icsk_ack.ato, delay);
 			inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
-						  (3 * tcp_rto_min(sk)) / 4,
-						  TCP_RTO_MAX);
+						  delay, TCP_RTO_MAX);
+		}
 	}
 	return 1;
I think this code is trying to aggressively stretch the ACK when
prequeueing.  In order to make sure there is enough time to get
the process on the CPU and send a response, and thus piggyback
the ACK.

If that turns out not to really matter, or matter less than your
problem, then we can make your change and I'm all for it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help