From patchwork Sat Sep 20 21:47:57 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 751 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 8115EDDEDE for ; Sun, 21 Sep 2008 07:48:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754123AbYITVsi (ORCPT ); Sat, 20 Sep 2008 17:48:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754106AbYITVsh (ORCPT ); Sat, 20 Sep 2008 17:48:37 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:56256 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbYITVsI (ORCPT ); Sat, 20 Sep 2008 17:48:08 -0400 Received: from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi [128.214.166.179]) (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Sun, 21 Sep 2008 00:47:59 +0300 id 0005BEF2.48D56F8F.0000546E Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795) id 197D1A00A4; Sun, 21 Sep 2008 00:47:59 +0300 (EEST) From: "=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" To: David Miller Cc: netdev@vger.kernel.org, "=?utf-8?q?Ilpo=20J=E4rvinen?=" Subject: [PATCHv2 net-next 14/15] tcp: don't clear lost_skb_hint when not necessary Date: Sun, 21 Sep 2008 00:47:57 +0300 Message-Id: <1221947278-16715-15-git-send-email-ilpo.jarvinen@helsinki.fi> X-Mailer: git-send-email 1.5.4.2.156.ge3c5 In-Reply-To: <1221947278-16715-14-git-send-email-ilpo.jarvinen@helsinki.fi> References: <1221947278-16715-1-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-2-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-3-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-4-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-5-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-6-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-7-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-8-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-9-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-10-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-11-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-12-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-13-git-send-email-ilpo.jarvinen@helsinki.fi> <1221947278-16715-14-git-send-email-ilpo.jarvinen@helsinki.fi> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Most importantly avoid doing it with cumulative ACK. However, since we have lost_cnt_hint in the picture as well needing adjustments, it's not as trivial as dealing with retransmit_skb_hint (and cannot be done in the all place we could trivially leave retransmit_skb_hint untouched). With the previous patch, this should mostly remove O(n^2) behavior while cumulative ACKs start flowing once rexmit after a lossy round-trip made it through. Signed-off-by: Ilpo Järvinen --- net/ipv4/tcp_input.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 44a4fff..85627f8 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2844,6 +2844,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) int flag = 0; u32 pkts_acked = 0; u32 reord = tp->packets_out; + u32 prior_sacked = tp->sacked_out; s32 seq_rtt = -1; s32 ca_seq_rtt = -1; ktime_t last_ackt = net_invalid_timestamp(); @@ -2925,9 +2926,11 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) tcp_unlink_write_queue(skb, sk); sk_wmem_free_skb(sk, skb); - tcp_clear_retrans_hints_partial(tp); + tp->scoreboard_skb_hint = NULL; if (skb == tp->retransmit_skb_hint) tp->retransmit_skb_hint = NULL; + if (skb == tp->lost_skb_hint) + tp->lost_skb_hint = NULL; } if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) @@ -2946,6 +2949,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) /* Non-retransmitted hole got filled? That's reordering */ if (reord < prior_fackets) tcp_update_reordering(sk, tp->fackets_out - reord, 0); + + /* No need to care for underflows here because + * the lost_skb_hint gets NULLed if we're past it + * (or something non-trivial happened) + */ + if (tcp_is_fack(tp)) + tp->lost_cnt_hint -= pkts_acked; + else + tp->lost_cnt_hint -= prior_sacked - tp->sacked_out; } tp->fackets_out -= min(pkts_acked, tp->fackets_out);