netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johunt@akamai.com
Cc: netdev@vger.kernel.org, edumazet@google.com
Subject: Re: [PATCH] fix tcp fin memory accounting
Date: Fri, 20 Mar 2015 13:20:29 -0400 (EDT)	[thread overview]
Message-ID: <20150320.132029.103306583158863864.davem@davemloft.net> (raw)
In-Reply-To: <1426807170-19258-1-git-send-email-johunt@akamai.com>

From: Josh Hunt <johunt@akamai.com>
Date: Thu, 19 Mar 2015 19:19:30 -0400

> tcp_send_fin() does not account for the memory it allocates properly, so
> sk_forward_alloc can be negative in cases where we've sent a FIN:
> 
> ss example output (ss -amn | grep -B1 f4294):
> tcp    FIN-WAIT-1 0      1            192.168.0.1:45520         192.0.2.1:8080
> 	skmem:(r0,rb87380,t0,tb87380,f4294966016,w1280,o0,bl0)
> --
> tcp    FIN-WAIT-1 0      1            192.168.0.1:8080          192.0.2.1:59710
> 	skmem:(r0,rb87380,t0,tb87380,f4294966016,w1280,o0,bl0)
> 
> This can be resolved by using sk_stream_alloc_skb() instead of calling alloc_skb_fclone()
> directly. The same fix was made in tcp_connect() in commit 355a901e6cf1 (tcp: make connect() mem charging friendly).
> 
> With this fix applied I no longer see the negative sk_forward_alloc values (or
> very large values repoted by ss) in my tests.
> 
> Signed-off-by: Josh Hunt <johunt@akamai.com>

Applied and queued up for -stable, thanks.

  parent reply	other threads:[~2015-03-20 17:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 23:19 [PATCH] fix tcp fin memory accounting Josh Hunt
2015-03-20  2:17 ` Eric Dumazet
2015-03-20 17:20 ` David Miller [this message]
2015-03-20 17:36   ` Josh Hunt
2015-03-24  6:10     ` David Miller
2015-03-24  6:11       ` Josh Hunt
2015-04-22  0:09         ` Eric Dumazet
2015-04-22  1:32           ` [PATCH net] tcp: fix possible deadlock in tcp_send_fin() Eric Dumazet
2015-04-22 14:33             ` [PATCH net] net: do not deplete pfmemalloc reserve Eric Dumazet
2015-04-22 19:35               ` David Miller
2015-04-22 20:20                 ` Eric Dumazet
2015-04-22 20:24                   ` David Miller
2015-04-22 18:15             ` [PATCH net] tcp: fix possible deadlock in tcp_send_fin() David Miller
2015-04-22 18:39               ` Eric Dumazet
2015-04-22 18:50                 ` David Miller
2015-04-22 19:12                   ` Eric Dumazet
2015-04-22 19:29                     ` David Miller
2015-04-23 13:48           ` [PATCH] fix tcp fin memory accounting Josh Hunt
2015-04-23 14:02             ` Eric Dumazet
2015-04-23 15:54               ` David Miller
2015-04-23 16:16                 ` Eric Dumazet
2015-04-23 16:48                   ` Eric Dumazet
2015-04-23 17:12                     ` David Miller
2015-04-23 17:42                       ` [PATCH net] tcp: avoid looping in tcp_send_fin() Eric Dumazet
2015-04-24 15:07                         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150320.132029.103306583158863864.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=johunt@akamai.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).