From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 47F9A21F095 for ; Wed, 11 Jul 2012 16:47:43 -0700 (PDT) Received: by wgbfa7 with SMTP id fa7so1196955wgb.28 for ; Wed, 11 Jul 2012 16:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=Mmm5ZQsxZ8jbSf2NIeGDXOcXk83kcp0WVgpRD1fEiWE=; b=Y+4x6xuf/Xi2++AsgOgnrTzgeJXJRujx958jddv4CLzmRGb+v5jA8q8hX1iVbN6jK+ 7pwG7sDqJbjxqP8HU/BUGbVE0n1ybfmBCrWmiqVPjG08mJgBIoY05+wrXF1l7DQmb6Ma bvY/RZnm3jYA/rNXRVNMwVhrvH21g9EWP0EsN5u2pPahydELCn3UXrGFJ5WosKmv6Ad8 Nd5UIbhDedZA09fDdT+DbrNGnR4B3ngk7QZr8FBc71My9h2BSxvC+DaQDgTFbUH9WRe2 d0vWoT42jaCpaNfBXzIdobEp4t9HNKaDRNq7ve6GQMcO6bHA8ggho0eD76bGLyqrbPob WBOQ== Received: by 10.180.106.137 with SMTP id gu9mr51000689wib.20.1342050461214; Wed, 11 Jul 2012 16:47:41 -0700 (PDT) Received: from [172.28.88.151] ([74.125.122.49]) by mx.google.com with ESMTPS id el6sm36982931wib.8.2012.07.11.16.47.38 (version=SSLv3 cipher=OTHER); Wed, 11 Jul 2012 16:47:40 -0700 (PDT) From: Eric Dumazet To: Andi Kleen In-Reply-To: References: <1342021831.3265.8174.camel@edumazet-glaptop> Content-Type: text/plain; charset="UTF-8" Date: Thu, 12 Jul 2012 01:47:37 +0200 Message-ID: <1342050457.3265.8193.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Cc: nanditad@google.com, netdev@vger.kernel.org, codel@lists.bufferbloat.net, mattmathis@google.com, ncardwell@google.com, David Miller Subject: Re: [Codel] [PATCH v3 net-next] tcp: TCP Small Queues X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:47:43 -0000 On Wed, 2012-07-11 at 11:38 -0700, Andi Kleen wrote: > Eric Dumazet writes: > > + > > + if (!sock_owned_by_user(sk)) { > > + if ((1 << sk->sk_state) & > > + (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 | > > + TCPF_CLOSING | TCPF_CLOSE_WAIT)) > > + tcp_write_xmit(sk, > > + tcp_current_mss(sk), > > + 0, 0, > > + GFP_ATOMIC); > > Did you have any problems with the GFP_ATOMIC allocation failing here? > I think you move some skb allocs from process context to ATOMIC, right? > > It relies on the VM somehow catching up in another context. > > May be interesting to try out under very high memory pressure. AFAIK this patch has no effect on memory allocations, because : At write() time, we use GFP_KERNEL allocations to build the socket write queue. And each skb is "precloned", that is allocated from skbuff_fclone_cache. Then, when we select some skbs from write for transmission, we clone them. And this cloning doesnt allocate memory, because we use the fast cloning. There are some pathological cases were we do allocate memory, but TSQ should lower probabilities : 1) when we skb_clone(skb), we might need an allocation if the previous clone is still in flight. This is a retransmit case, and TSQ only takes care of transmits (of previously unsent skbs : their fast clone is available) 2) When we need to split the skb because not enough cwnd is available. As TSQ tends to limit number of skbs in qdisc, we lower the probabilities of such splits. Anyway a TSO split only need an sk_buff, this is not a lot of memory. 3) On bulk sends, most transmits are triggered by incoming ACKS, in softirq context, so already using GFP_ATOMIC "allocations", if ever needed (see point 1) Thanks