Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1014871pxb; Wed, 1 Sep 2021 15:19:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/4JkUnOAV79HycbLVOMTaqJhlf0qxEU3ouWIlhSa6r1KMjyuAp0gbzz7+PXY791UPARxv X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr114480ejc.196.1630534789897; Wed, 01 Sep 2021 15:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630534789; cv=none; d=google.com; s=arc-20160816; b=PLOpHsZTJx4stG9QdRRpOopVVUK1yB3zUyq8GIeb7Vq0kuenGpaK0bzLBYfnEOk+to 6N8aEV4I4fYO4W67/7DHJnAnTHT3IRqWiXNaUtUX96dSPQSJy/i3eYoZesbndAtIKQ7k ORGTReRpUdBIOxlPZ+c4VOCRGaeSPVwF8W1m7F4M7UphXRuXz0q4xtkAuj5YrvxejQ2d adcw/Jx6K8GyMDHa5t5jQthgZ9vvrdCQj66hGnED6bo8dhhXedQ7DhPDHDbQJSC1hkn+ u+SUD7uuz+pYm/+g04O1ZtxrlDnV7c2icluM8DV1cf3beo1PCbiAnbTG0Chspf2umefN FK3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kAtBgHF0gcwAmOsoBYgbtR9s6UnHjuUv/WK3PPaU+Vk=; b=IAlDXAgsjX8qXY2gGEKJ6nrnqvzmOaxga0yJ3kY7Mj3GYkjDf21LrlcpYRsRdKBbr8 q9w2SHj5brBdZArGUzb3BFqPayVTePSo8CXcuwFSrJcWjSTYa8zMSnonxyzurgrg71Ft 3XvFZMueEC3Jw0dGmV8hH/kaN6mrE6jKODNZvWIcTHfAHnmioB3E05JkaPjpeMndqPPu UthMryE6nvPFpQAtOf9SXryuhGA3k01ckWmw2Z4Hkt4eDhCUlDBf0Dlk09hBeLCT0JbG PY5ZbybpP5vD+hAPYcpLnsEZWia/g9sI5FIRzBsx7iM2EA8j6DQIveA8jGjsVyD+SfA0 TACA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=wOCETBUh; 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 cw2si1006951ejc.730.2021.09.01.15.19.20; Wed, 01 Sep 2021 15:19:49 -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=wOCETBUh; 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 S245036AbhIAPIC (ORCPT + 99 others); Wed, 1 Sep 2021 11:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231807AbhIAPIC (ORCPT ); Wed, 1 Sep 2021 11:08:02 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F527C061575 for ; Wed, 1 Sep 2021 08:07:05 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id e133so5855191ybh.0 for ; Wed, 01 Sep 2021 08:07:05 -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=kAtBgHF0gcwAmOsoBYgbtR9s6UnHjuUv/WK3PPaU+Vk=; b=wOCETBUhws2xVptafq9Ls+XIFtkF/TtQ2NwqJrghoobiNV0wgCNZIl8Se6VuLJrvL2 riPy9GCBMi6LH+XjVfa8cpbaQ3OgWKeLmmMGU0A4rYHYv6Kjrcs4/NraerKnYO4ZKm9+ cm7zrI0NZDW0QS/NAzAgGoGubAqsnkISCCChMNg7hIGxqwwVCnsjD9FeSfbJ/i8wFGBH N0ygzBLZtV2Xp8udATxzWD9KsNVSQ0IiIwv1w2o/nbyAfOIjo1FRwyKRVaS2p7ERJE4+ RikJiBpdE9JsxudSJQI+9PwcNvZOiRWZ7avjd6DieJYJzaSmwOUcn0Hph7gyWQSBhRQ6 Sj5g== 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=kAtBgHF0gcwAmOsoBYgbtR9s6UnHjuUv/WK3PPaU+Vk=; b=Lt8b11ejCZu51XtRYYf7N2QDNkheI0YoamnUeRmnOuH+9hgz6inUo/W85wvR3SCvsj H+fdBX+aWtvj2wqKW/XKe0rmw1V1R0heLxgGxDax2zigS6F9Yx/y/IAEIn3AstrPKYik BdDCZIFzQJe3jkQU0MQJRfvtTBH/baapd5nKioK9uDarT4Ee3fnW4vv3MEv3LDRHHMyD MV6wwQQ+PT1TK6Mfe74knpHEiS5qG9XeNO+Mq7zbvVT2yijfPhBKZuyiZjm6U69Py+WQ EjuZK7Cf6tt5zIwRS2aD2WNPBBCASYoLYZYrrjL3hbuoYAliHkPR1fYLs0hMn8OM8Oua 8gTQ== X-Gm-Message-State: AOAM533H+8SUcbaGqjSYBcByGD60lvHuKDdcqzMPyuC+3ER4JuQZR0p0 xaPOdc/zzfjKzK7SETPCqJz/ZxHACK5aWQf/v7rVJXl6oPou0Q== X-Received: by 2002:a25:444:: with SMTP id 65mr38851184ybe.520.1630508824013; Wed, 01 Sep 2021 08:07:04 -0700 (PDT) MIME-Version: 1.0 References: <1630492744-60396-1-git-send-email-linyunsheng@huawei.com> <9c9ef2228dfcb950b5c75382bd421c6169e547a0.camel@redhat.com> In-Reply-To: <9c9ef2228dfcb950b5c75382bd421c6169e547a0.camel@redhat.com> From: Eric Dumazet Date: Wed, 1 Sep 2021 08:06:52 -0700 Message-ID: Subject: Re: [PATCH net-next] tcp: add tcp_tx_skb_cache_key checking in sk_stream_alloc_skb() To: Paolo Abeni Cc: Yunsheng Lin , David Miller , Jakub Kicinski , MPTCP Upstream , netdev , LKML , linuxarm@openeuler.org, Hideaki YOSHIFUJI , David Ahern Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 1, 2021 at 3:52 AM Paolo Abeni wrote: > > On Wed, 2021-09-01 at 18:39 +0800, Yunsheng Lin wrote: > > Since tcp_tx_skb_cache is disabled by default in: > > commit 0b7d7f6b2208 ("tcp: add tcp_tx_skb_cache sysctl") > > > > Add tcp_tx_skb_cache_key checking in sk_stream_alloc_skb() to > > avoid possible branch-misses. > > > > Signed-off-by: Yunsheng Lin > > Note that MPTCP is currently exploiting sk->sk_tx_skb_cache. If we get > this patch goes in as-is, it will break mptcp. > > One possible solution would be to let mptcp usage enable sk- > >sk_tx_skb_cache, but that has relevant side effects on plain TCP. > > Another options would be re-work once again the mptcp xmit path to > avoid using sk->sk_tx_skb_cache. > Hmmm, I actually wrote a revert of this feature but forgot to submit it last year. commit c36cfbd791f62c0f7c6b32132af59dfdbe6be21b (HEAD -> listener_scale4) Author: Eric Dumazet Date: Wed May 20 06:38:38 2020 -0700 tcp: remove sk_{tr}x_skb_cache This reverts the following patches : 2e05fcae83c41eb2df10558338dc600dc783af47 ("tcp: fix compile error if !CONFIG_SYSCTL") 4f661542a40217713f2cee0bb6678fbb30d9d367 ("tcp: fix zerocopy and notsent_lowat issues") 472c2e07eef045145bc1493cc94a01c87140780a ("tcp: add one skb cache for tx") 8b27dae5a2e89a61c46c6dbc76c040c0e6d0ed4c ("tcp: add one skb cache for rx") Having a cache of one skb (in each direction) per TCP socket is fragile, since it can cause a significant increase of memory needs, and not good enough for high speed flows anyway where more than one skb is needed. We want instead to add a generic infrastructure, with more flexible per-cpu caches, for alien NUMA nodes. Signed-off-by: Eric Dumazet I will update this commit to also remove the part in MPTCP. Let's remove this feature and replace it with something less costly.