public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Patch "tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP" has been added to the 4.9-stable tree
@ 2017-08-25  0:45 gregkh
  2017-08-25  1:07 ` Neal Cardwell
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2017-08-25  0:45 UTC (permalink / raw)
  To: ncardwell, davem, edumazet, gregkh, ycheng; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tcp-when-rearming-rto-if-rto-time-is-in-past-then-fire-rto-asap.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu Aug 24 17:44:02 PDT 2017
From: Neal Cardwell <ncardwell@google.com>
Date: Wed, 16 Aug 2017 17:53:36 -0400
Subject: tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP

From: Neal Cardwell <ncardwell@google.com>


[ Upstream commit cdbeb633ca71a02b7b63bfeb94994bf4e1a0b894 ]

In some situations tcp_send_loss_probe() can realize that it's unable
to send a loss probe (TLP), and falls back to calling tcp_rearm_rto()
to schedule an RTO timer. In such cases, sometimes tcp_rearm_rto()
realizes that the RTO was eligible to fire immediately or at some
point in the past (delta_us <= 0). Previously in such cases
tcp_rearm_rto() was scheduling such "overdue" RTOs to happen at now +
icsk_rto, which caused needless delays of hundreds of milliseconds
(and non-linear behavior that made reproducible testing
difficult). This commit changes the logic to schedule "overdue" RTOs
ASAP, rather than at now + icsk_rto.

Fixes: 6ba8a3b19e76 ("tcp: Tail loss probe (TLP)")
Suggested-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/tcp_input.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3036,8 +3036,7 @@ void tcp_rearm_rto(struct sock *sk)
 			/* delta may not be positive if the socket is locked
 			 * when the retrans timer fires and is rescheduled.
 			 */
-			if (delta > 0)
-				rto = delta;
+			delta = max(delta, 1);
 		}
 		inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
 					  TCP_RTO_MAX);


Patches currently in stable-queue which might be from ncardwell@google.com are

queue-4.9/tcp-when-rearming-rto-if-rto-time-is-in-past-then-fire-rto-asap.patch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch "tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP" has been added to the 4.9-stable tree
  2017-08-25  0:45 Patch "tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP" has been added to the 4.9-stable tree gregkh
@ 2017-08-25  1:07 ` Neal Cardwell
  2017-08-25  1:26   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Neal Cardwell @ 2017-08-25  1:07 UTC (permalink / raw)
  To: Greg KH; +Cc: David Miller, Eric Dumazet, Yuchung Cheng, stable, stable-commits

On Thu, Aug 24, 2017 at 8:45 PM,  <gregkh@linuxfoundation.org> wrote:
>  net/ipv4/tcp_input.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3036,8 +3036,7 @@ void tcp_rearm_rto(struct sock *sk)
>                         /* delta may not be positive if the socket is locked
>                          * when the retrans timer fires and is rescheduled.
>                          */
> -                       if (delta > 0)
> -                               rto = delta;
> +                       delta = max(delta, 1);

This probably should be:

  rto = max(delta, 1);

I think the 4.12-stable backport looks good, but the 3.18, 4.4, and
4.9 backports have this issue.

Thanks,
neal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch "tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP" has been added to the 4.9-stable tree
  2017-08-25  1:07 ` Neal Cardwell
@ 2017-08-25  1:26   ` David Miller
  2017-08-25  1:38     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2017-08-25  1:26 UTC (permalink / raw)
  To: ncardwell; +Cc: gregkh, edumazet, ycheng, stable, stable-commits

From: Neal Cardwell <ncardwell@google.com>
Date: Thu, 24 Aug 2017 21:07:56 -0400

> On Thu, Aug 24, 2017 at 8:45 PM,  <gregkh@linuxfoundation.org> wrote:
>>  net/ipv4/tcp_input.c |    3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> --- a/net/ipv4/tcp_input.c
>> +++ b/net/ipv4/tcp_input.c
>> @@ -3036,8 +3036,7 @@ void tcp_rearm_rto(struct sock *sk)
>>                         /* delta may not be positive if the socket is locked
>>                          * when the retrans timer fires and is rescheduled.
>>                          */
>> -                       if (delta > 0)
>> -                               rto = delta;
>> +                       delta = max(delta, 1);
> 
> This probably should be:
> 
>   rto = max(delta, 1);
> 
> I think the 4.12-stable backport looks good, but the 3.18, 4.4, and
> 4.9 backports have this issue.

My bad.

Greg could you please fix this up for me?

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch "tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP" has been added to the 4.9-stable tree
  2017-08-25  1:26   ` David Miller
@ 2017-08-25  1:38     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2017-08-25  1:38 UTC (permalink / raw)
  To: David Miller; +Cc: ncardwell, edumazet, ycheng, stable, stable-commits

On Thu, Aug 24, 2017 at 06:26:45PM -0700, David Miller wrote:
> From: Neal Cardwell <ncardwell@google.com>
> Date: Thu, 24 Aug 2017 21:07:56 -0400
> 
> > On Thu, Aug 24, 2017 at 8:45 PM,  <gregkh@linuxfoundation.org> wrote:
> >>  net/ipv4/tcp_input.c |    3 +--
> >>  1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> --- a/net/ipv4/tcp_input.c
> >> +++ b/net/ipv4/tcp_input.c
> >> @@ -3036,8 +3036,7 @@ void tcp_rearm_rto(struct sock *sk)
> >>                         /* delta may not be positive if the socket is locked
> >>                          * when the retrans timer fires and is rescheduled.
> >>                          */
> >> -                       if (delta > 0)
> >> -                               rto = delta;
> >> +                       delta = max(delta, 1);
> > 
> > This probably should be:
> > 
> >   rto = max(delta, 1);
> > 
> > I think the 4.12-stable backport looks good, but the 3.18, 4.4, and
> > 4.9 backports have this issue.
> 
> My bad.
> 
> Greg could you please fix this up for me?

Yes, will do.  Neal, good catch.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-25  1:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25  0:45 Patch "tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP" has been added to the 4.9-stable tree gregkh
2017-08-25  1:07 ` Neal Cardwell
2017-08-25  1:26   ` David Miller
2017-08-25  1:38     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox