Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1292389ybg; Thu, 4 Jun 2020 06:13:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA97l69/snnE0Y/nJ8eUDRjec2F8He+kg7K5Lr/U2WQi1UqG+JWnLAPxwDHvkjZOvcc7Mu X-Received: by 2002:a17:906:1116:: with SMTP id h22mr3728479eja.350.1591276427093; Thu, 04 Jun 2020 06:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591276427; cv=none; d=google.com; s=arc-20160816; b=jPf6oyNRWEU6bJPBixolzAewG7NN5/jYs5JtyVfsjOs/iQxlb17KUCdY9UV9zgawOg JPReUul9RJL49WOMjUwSkav5wk67I2eGpNTCatAWuSbKk/koCTdTSx9PTDlnBrjdfyvk 8ACPbySBrEuqp3dMXD2k1lfSaKsqgYjLlogzsQMJlHn7bdOrfddtPKg1tkBoomnWZ27e PVBTlaK2UKe/ytVa7/HXyxdjGbVHSFLH3FPVmPoI0/E4lij4GCuAMUuipd6nUj4az+Dl oRz89NW2nAEZ6aMXJnnAwgZWo3TCtWTkl2sxXETKalV0K9eOJoJDMk/2hk97tCWeTOC7 W9pg== 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=bsgm/TKaQa1WLgF7Jlo3Jkj2UeTFocZUCUKf1011cuc=; b=uHSZiANT18bXqmTLjjt6A3ClYPPHxK6xDK7ZD39KqRCdEkYykIcV5GDL9mkBOhkb9G whFGuqkBgDlIMy+VMKQ5fCQc8ZUhLdNT3SLTN4RboKBacwDtYKGTnkfxVf2i4XGoLz4G iOEL6FE+B22+Kmrpa+0zzbOccQs6ga8Wi3v2Ed25UH+te83xletMjb2Wkk8UZFC2vvwa TGwI+53xHNgV/mGH/5U5IbHSffdPmgLSDBPqHvm5K//oAqo2uowGQPJ5GPIvA+96vO5R JmvwdD6KSV8aX6zaqgAmRWI2ezk8AVP3PuU4A1yJ+l7EPnX75Srbv2xViziz6vDv1gTq H8mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dNTx6mqq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha25si1646830ejb.180.2020.06.04.06.13.22; Thu, 04 Jun 2020 06:13:47 -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=@google.com header.s=20161025 header.b=dNTx6mqq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbgFDNK4 (ORCPT + 99 others); Thu, 4 Jun 2020 09:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728038AbgFDNKz (ORCPT ); Thu, 4 Jun 2020 09:10:55 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76CFC08C5C1 for ; Thu, 4 Jun 2020 06:10:55 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id n123so2892823ybf.11 for ; Thu, 04 Jun 2020 06:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bsgm/TKaQa1WLgF7Jlo3Jkj2UeTFocZUCUKf1011cuc=; b=dNTx6mqqy7cKYr6LeBPm8T8QMP1bWemgs9tn5LA8PwwT5b9uYGoEOO7nrOaxI8HSgF sEkATWLylk3rMeS/XsK4JQOIle/TBs+afxA6rQs0zIYiJ0x62J6r+GwZ2LCTYxp0BCKb 9rt5tPJGyKGDibCWDRwcopwAeXl7sqD6BwjYGQY47CJ0L6/WdO4AHMy9r1ZUDb133Xjn nui8+40mbwrG5+Ol0llqxLbYmTQHQtjzRbkxRoIm0I+24yleuQpyUDGZ6vqGtTLdPtGL 4t1QXO+QZbPsYYArVgVv0FvLy1RiB6Sph6aE7NfPVSzXPeciKWwSSTs8wAsr4xPySlWW ikTg== 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=bsgm/TKaQa1WLgF7Jlo3Jkj2UeTFocZUCUKf1011cuc=; b=e7Nn//LPnsccPw8YJ7ToWSPGa6Ax0t8llAXr3kiC7bVU2ddEFbkdbkv7Xj9jfqLoFi Sk7tV1KHKCLDLwpPR0FjjiMNaLKml1u+qIbESUdQS6EX7gRxBbv2Fif5NcZchLL+Hoso T7Jka6KQKriOYxhXVMo2mJ4K090I26nVRuiVHXUZ/eAiHvjHF51jat6couFf0L/8HAmO gQRB8g28+KbvNXCqg2CWxs+bNkCfJJ463m1w1P+G9F9TER+5urzfq7CNByh9VhBSqwqy PC6Y/bZEkWrLKYm5yF4bJCli5WjKDq9ugNcCRjn9mXamlQ4I/fCxuaFyNckQryDzzpce uJrQ== X-Gm-Message-State: AOAM5309HYBhzC4BqOHXraE9JY1arYhvbYgjMNNH8GdMgLgJ+OUm3mJ2 If1oiIf/VfHtdIImKh4xQxNbf+S2d1IFBlRU1jtcUg== X-Received: by 2002:a25:4cc4:: with SMTP id z187mr8163120yba.274.1591276254605; Thu, 04 Jun 2020 06:10:54 -0700 (PDT) MIME-Version: 1.0 References: <20200602080425.93712-1-kerneljasonxing@gmail.com> <20200604090014.23266-1-kerneljasonxing@gmail.com> In-Reply-To: <20200604090014.23266-1-kerneljasonxing@gmail.com> From: Eric Dumazet Date: Thu, 4 Jun 2020 06:10:43 -0700 Message-ID: Subject: Re: [PATCH v2 4.19] tcp: fix TCP socks unreleased in BBR mode To: Jason Xing Cc: Greg Kroah-Hartman , Neal Cardwell , 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 On Thu, Jun 4, 2020 at 2:01 AM wrote: > > From: Jason Xing > > When using BBR mode, too many tcp socks cannot be released because of > duplicate use of the sock_hold() in the manner of tcp_internal_pacing() > when RTO happens. Therefore, this situation maddly increases the slab > memory and then constantly triggers the OOM until crash. > > Besides, in addition to BBR mode, if some mode applies pacing function, > it could trigger what we've discussed above, > > 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 and loss to simulate the RTO 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. > > v2: extend the timer which could cover all those related potential risks > (suggested by Eric Dumazet and Neal Cardwell) > > Signed-off-by: Jason Xing > Signed-off-by: liweishi > Signed-off-by: Shujin Li That is not how things work really. I will submit this properly so that stable teams do not have to guess how to backport this to various kernels. Changelog is misleading, this has nothing to do with BBR, we need to be precise. Thank you.