Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp134411ybg; Tue, 2 Jun 2020 18:56:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRqPlsE9qYmurYjdHc/7e0iR72OfOXu/VYroCesVOX4TEMOSNd9hstPwANEriDpCzArJ1x X-Received: by 2002:a17:906:3bd8:: with SMTP id v24mr1028881ejf.231.1591149386978; Tue, 02 Jun 2020 18:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591149386; cv=none; d=google.com; s=arc-20160816; b=Ss+yKEEdaLaUEqCBXRn3TfqelGxgQRDNkVky943C4HgpAuwzzNaqiGV6iYUxXzQmji urS78Sw5Jo05dsYY1Jl2JnspbbOl9+6HvsfIZ9e6ppYKH2ZKfJ4lAAy3wjEeyHOCb+CY zEhL5E3DBGStGBJsU6R3VGyd7WJVEaUjyJbXRvrB9yGkvD5wM6HnU8CAu0o9Gci/5OPy suWIeeu0s7mbo4C8u79VUS7R4k+5w7C34Y+NWnDHxhgWSSxsSx7YnlZOLS6HNrIlLR3o WLq9jd5CUqZE+oCOlPMFjdByWF4s/Bi2HC38oXsg+yQZg2co1d9pam+KCzYoIy5BjpId +kUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IXyjPldssMSiKQfQfztOYSdzyap64t/hNOEyR2JogWw=; b=pOaA8/6FSEF/FN4VKnrLeRK6QwaeGGINzwzi77v6Vkze/xT3byA1nTKNqZJypQNxiP 7y523dbXOLAOCCjgSDr0YWGS2dIbJWkv7jGwyG/zjq4xRXgy3HV5yzxj8OlNc9RNZ6j2 mWJxcKDeXIWyXl4iu5g3U6rEzcJbkK2rEQ/E4ucG7lkFBjOdccHFRPQwed4XebTZ5ZLu /HgaW4Jdp6/FNcx/4DUTxBdbiNzYpFR1Na6FryaXUznkZHYXsfDna6IoCPNPiZJDRoti lnwA+0eurcVXCV/tVYlR6ztErCRRVYKRVJ2+Zwe8zvMwwmOZzrIVn8NNm9s5cefz1pRk BoSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WeVBCx2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si354605ejw.326.2020.06.02.18.56.04; Tue, 02 Jun 2020 18:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WeVBCx2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbgFCBxt (ORCPT + 99 others); Tue, 2 Jun 2020 21:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgFCBxs (ORCPT ); Tue, 2 Jun 2020 21:53:48 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C51EC08C5C0; Tue, 2 Jun 2020 18:53:48 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id 9so661114ljc.8; Tue, 02 Jun 2020 18:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IXyjPldssMSiKQfQfztOYSdzyap64t/hNOEyR2JogWw=; b=WeVBCx2lg1qJ7F+AQmKynH1A1/xigy0hdupKSIWoP0EEn4ZGyZOWgjAAtRGmNj49B6 SV3pWh6UdxPQ5VGk2B8nx5sIHxWVNx7rwFC3qDn9q/B3CxzCYtw6D3392XQq29QOb+UM aZanPp6wPMSn/4yjMI6hUwq71SzOWkxZhANcQhPWhscJoYvCwYokySFMr2+0APVb1y5A cDx2tZI4WqyzXcf1yz0+d4m/49lLeTrcrPYpuKjWGZ0a3Hh3T4b0L9f84jUdzn9KBcMg 86gtO4loxVFOq8gI4dYURUTSTxjrC21djPZgbDTkadBp95cR7N0yObmgwp0tYW03cuVi pU9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IXyjPldssMSiKQfQfztOYSdzyap64t/hNOEyR2JogWw=; b=AXXlUA2Tcgk7la3bC7VZ+UtX114llcw1VqTPJlSrohUu/3rHoXqlG6YORfdM9P+vvT VqYrnbg72yUMAnFGUWbPu/MM5wiLTPNoyrhrKIiRV1Yf2qkbRtZKF/py28qLHZzn3ieL X+DejbocAmY3JduSpmMaABExHMnDoh0yFlaCE1ksdSnO1RCBsx4afsGs8Jg5Z3gc3b1t 0ncZ3yM/g4cHJKeJ1nCthzPcvtZ+ds25Tlq0q/pGsPMabsDincVD1p/fjSZMoPp3njjC ImhOjyzSpaG0NCCOojYJdkVdY6defFof2oudH88rvj/PzqowLwQzTYWmzZ8swkH5PBPG ViKQ== X-Gm-Message-State: AOAM531N8coQ7spIORfdQhM+A2dem/tJmEkzls9vvpqPU540J1ce+MTW 14xwrUOjXqXdpSiAb7VgA+rvD6jJjW+iPXvJs5w= X-Received: by 2002:a2e:b611:: with SMTP id r17mr829195ljn.321.1591149226574; Tue, 02 Jun 2020 18:53:46 -0700 (PDT) MIME-Version: 1.0 References: <20200602080425.93712-1-kerneljasonxing@gmail.com> In-Reply-To: From: Jason Xing Date: Wed, 3 Jun 2020 09:53:10 +0800 Message-ID: Subject: Re: [PATCH] tcp: fix TCP socks unreleased in BBR mode To: Eric Dumazet Cc: David Miller , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev , LKML , liweishi@kuaishou.com, Shujin Li Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, I'm sorry that I didn't write enough clearly. We're running the pristine 4.19.125 linux kernel (the latest LTS version) and have been haunted by such an issue. This patch is high-important, I think. So I'm going to resend this email with the [patch 4.19] on the headline and cc Greg. Thanks, Jason On Tue, Jun 2, 2020 at 9:05 PM Eric Dumazet wrote: > > On Tue, Jun 2, 2020 at 1:05 AM wrote: > > > > From: Jason Xing > > > > TCP socks cannot be released because of the sock_hold() increasing the > > sk_refcnt in the manner of tcp_internal_pacing() when RTO happens. > > Therefore, this situation could increase the slab memory and then trigger > > the OOM if the machine has beening running for a long time. This issue, > > however, can happen on some machine only running a few days. > > > > We add one exception case to avoid unneeded use of sock_hold if the > > pacing_timer is enqueued. > > > > Reproduce procedure: > > 0) cat /proc/slabinfo | grep TCP > > 1) switch net.ipv4.tcp_congestion_control to bbr > > 2) using wrk tool something like that to send packages > > 3) using tc to increase the delay in the dev to simulate the busy case. > > 4) cat /proc/slabinfo | grep TCP > > 5) kill the wrk command and observe the number of objects and slabs in TCP. > > 6) at last, you could notice that the number would not decrease. > > > > Signed-off-by: Jason Xing > > Signed-off-by: liweishi > > Signed-off-by: Shujin Li > > --- > > net/ipv4/tcp_output.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c > > index cc4ba42..5cf63d9 100644 > > --- a/net/ipv4/tcp_output.c > > +++ b/net/ipv4/tcp_output.c > > @@ -969,7 +969,8 @@ static void tcp_internal_pacing(struct sock *sk, const struct sk_buff *skb) > > u64 len_ns; > > u32 rate; > > > > - if (!tcp_needs_internal_pacing(sk)) > > + if (!tcp_needs_internal_pacing(sk) || > > + hrtimer_is_queued(&tcp_sk(sk)->pacing_timer)) > > return; > > rate = sk->sk_pacing_rate; > > if (!rate || rate == ~0U) > > -- > > 1.8.3.1 > > > > Hi Jason. > > Please do not send patches that do not apply to current upstream trees. > > Instead, backport to your kernels the needed fixes. > > I suspect that you are not using a pristine linux kernel, but some > heavily modified one and something went wrong in your backports. > Do not ask us to spend time finding what went wrong. > > Thank you.