lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 22 Feb 2014 22:40:45 -0500
From:	Neal Cardwell <ncardwell@...gle.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Yuchung Cheng <ycheng@...gle.com>,
	Nandita Dukkipati <nanditad@...gle.com>,
	Van Jacobson <vanj@...gle.com>
Subject: Re: [PATCH] tcp: reduce the bloat caused by tcp_is_cwnd_limited()

On Sat, Feb 22, 2014 at 4:52 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> From: Eric Dumazet <edumazet@...gle.com>
...
> diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
> index ad37bf18ae4b..d74ebfb64e2b 100644
> --- a/net/ipv4/tcp_cong.c
> +++ b/net/ipv4/tcp_cong.c
> @@ -277,7 +277,6 @@ int tcp_set_congestion_control(struct sock *sk, const char *name)
>  }
>
>  /* RFC2861 Check whether we are limited by application or congestion window
> - * This is the inverse of cwnd check in tcp_tso_should_defer
>   */
>  bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
>  {
> @@ -288,10 +287,7 @@ bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
>                 return true;
>
>         left = tp->snd_cwnd - in_flight;
> -       if (sk_can_gso(sk) &&
> -           left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd &&
> -           left * tp->mss_cache < sk->sk_gso_max_size &&
> -           left < sk->sk_gso_max_segs)
> +       if (sk_can_gso(sk) && left < tp->xmit_size_goal_segs)
>                 return true;
>         return left <= tcp_max_tso_deferred_mss(tp);
>  }

Nice catch!

AFAICT we should keep the expression in there pertaining to
sysctl_tcp_tso_win_divisor. AFAICT tcp_is_cwnd_limited() is supposed
to be saying, "are we cwnd limited? that is, is the available cwnd we
have left at zero, or so small that it is probably only non-zero
because tcp_tso_should_defer() is trying to accumulate permission to
send a bigger TSO skb?"

To implement this, it seems we need to keep the code that checks for
possible deferral from both the sysctl_tcp_tso_win_divisor code path
and the tcp_max_tso_deferred_mss() code paths.

So, to me, the comment "This is the inverse of cwnd check in
tcp_tso_should_defer" is still relevant (though not very clear).

So AFAICT we want the patch to be something like:

--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -290,8 +290,7 @@ bool tcp_is_cwnd_limited(const struct sock *sk,
u32 in_flight)
        left = tp->snd_cwnd - in_flight;
        if (sk_can_gso(sk) &&
            left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd &&
-           left * tp->mss_cache < sk->sk_gso_max_size &&
-           left < sk->sk_gso_max_segs)
+           left < sk->xmit_size_goal_segs)
                return true;
        return left <= tcp_max_tso_deferred_mss(tp);
 }

neal
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ