Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3313619pxb; Tue, 12 Jan 2021 11:22:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4WvpTFIUGgHiC+azjZAWCLOU4aoXzZxEF5CCfTtO6D974JkuY06G00D3PPJrJMtTZxqST X-Received: by 2002:a05:6402:524a:: with SMTP id t10mr239401edd.270.1610479335482; Tue, 12 Jan 2021 11:22:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610479335; cv=none; d=google.com; s=arc-20160816; b=RCbmf9CsEgVhLk7CzO2rzXPqnbUq1ln0MV7+M4UXwIYbAH4/BD04HGK/z74OD8Q5jR jA7Z9k6x/IpwxGH+QMXZ53Q+ta5LX0mUo+xLTnpX5a5aqhpS3wwCBGHsVhfaIooL9qAU Hp7VxXoOShJe5tWDa/0VPOkva8s1DqPTHmw8V9dWr2lQuaDULNLu3J4OPOlLXpYvLKOD yt6V9lib3bRpty/G3Sb3Eej2N/+4h2bp6g9jvQYeh1PYxN/aXmtnNBG3LKKxsFrTd3a+ 41aVWVa39acxDUU7UzP2NGmTOoJNVqcJn4IazxYA0enMRK8RkHqvDJ2jB8NS1IGH3ub9 ETcA== 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=GLy0xq7ELrD0STDo2NgYg2AFasbCsB9i1uOCD1YMdOg=; b=04KJLgGgcS+oE6coCgqK73AevGxVq/hGO/dGr67IilkKmeRkAORpbnu8D1V17pF0Nt mKLGKnKIoTJtLiNXWRUMgs41aN4hapj9s4VHee7KqIhob60FsnsuenyBwOzfdpij3B5W BpHbRXUp8TsWako9sB2tK4eq5YPnwkAg5YMdAQcqqUxZZzm35L71l/SJ32isp+LVNTw0 DzVU5egakOUr3RK9DBBCstLjZQqL1SnqrPOq3B6IUUgq8IZW9Q4Qisx6qXY+uJNO5SAI 2HmTBQxBWjyEpWuqD5pLsU4z96w4nTP06D7lUcbxrRL9bzSwPpK6+Bq6/h+J4jl22Txk TKrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eluIOJne; 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 a23si1688649edy.268.2021.01.12.11.21.41; Tue, 12 Jan 2021 11:22:15 -0800 (PST) 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=eluIOJne; 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 S2406759AbhALTUI (ORCPT + 99 others); Tue, 12 Jan 2021 14:20:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406471AbhALTUI (ORCPT ); Tue, 12 Jan 2021 14:20:08 -0500 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6FFC061575 for ; Tue, 12 Jan 2021 11:19:27 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id 81so6379096ioc.13 for ; Tue, 12 Jan 2021 11:19:27 -0800 (PST) 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=GLy0xq7ELrD0STDo2NgYg2AFasbCsB9i1uOCD1YMdOg=; b=eluIOJneUynVQdxqn0U6eBr+TxXjKsaXXjGqQ4qk7t8ATs4oVLWuFAfoQI1ie3oUah h3NDoU8fweqLlJ8k/j1wIgX5MiZslNNsdh14sWuYRahrsIG+MDH1FeQz7rzbRhgE1FHP 4XRb4WRKlQm77QKyh0R0leaHxrDn0D0fWZWLTpyk2kgd7HyUh7sGViCYPmCuiQEQg/+n j/J/1K1jKt/utDC/tPwIPWXjtiXQMXerFZaA6ZuFBzVhsFe03G6XcnaXXdVTnnlRzOVg MiJNOyma+CPDLvupZksJir4LJLTK34s3oy2+0bPFd+mE+mAHLccIOdEpfPTheQk3HCeG zgSQ== 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=GLy0xq7ELrD0STDo2NgYg2AFasbCsB9i1uOCD1YMdOg=; b=YU333boKc7bC5Wz1rJlrwmF14eqyRjqAJHVIXMu0LjE131wT3sIgi7mzZvXjtE+eAO HwEYuq7WKP1CvWBMjdfLJbS7YGwWV4jCTtrXqhfSSvurNxdsTG33nvZmScGY8nomKBnw s/x2DRClJw0j04wVHlHG6xaI7G5GJgTpBkuA8NlgfyTsDF5mB1EDd0kcv34D9xTNmkLf sGwLS6kGr7sZ3KR+VY35TkjZJUv8T3EfaB15i4HfAlqm/mQ/ZXf6rfQXjqabESavRR4c TD7KUie7OmTg3Ud4fMLeq4k82mS9uTDWx/txFEVK2ohtP4Jhw/kKmoGghMpl0ykxj1DJ VZXA== X-Gm-Message-State: AOAM5325Koiy2GITbz6pIIpzD/MzzZYAXABM6dI2cwgzUar1UFzv9OwE dMtSb4xZsR3oIIDQGMogppEvuplkHUSww/0IojoW2Q== X-Received: by 2002:a05:6e02:42:: with SMTP id i2mr606833ilr.68.1610479166918; Tue, 12 Jan 2021 11:19:26 -0800 (PST) MIME-Version: 1.0 References: <20210111182655.12159-1-alobakin@pm.me> <20210112105529.3592-1-alobakin@pm.me> <20210112182601.154198-1-alobakin@pm.me> In-Reply-To: <20210112182601.154198-1-alobakin@pm.me> From: Eric Dumazet Date: Tue, 12 Jan 2021 20:19:14 +0100 Message-ID: Subject: Re: [PATCH net-next 0/5] skbuff: introduce skbuff_heads bulking and reusing To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Edward Cree , Jonathan Lemon , Willem de Bruijn , Miaohe Lin , Steffen Klassert , Guillaume Nault , Yadu Kishore , Al Viro , netdev , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 7:26 PM Alexander Lobakin wrote: > > From: Eric Dumazet > Date: Tue, 12 Jan 2021 13:32:56 +0100 > > > On Tue, Jan 12, 2021 at 11:56 AM Alexander Lobakin wrote: > >> > > > >> > >> Ah, I should've mentioned that I use UDP GRO Fraglists, so these > >> numbers are for GRO. > >> > > > > Right, this suggests UDP GRO fraglist is a pathological case of GRO, > > not saving memory. > > > > Real GRO (TCP in most cases) will consume one skb, and have page > > fragments for each segment. > > > > Having skbs linked together is not cache friendly. > > OK, so I rebased test setup a bit to clarify the things out. > > I disabled fraglists and GRO/GSO fraglists support advertisement > in driver to exclude any "pathological" cases and switched it > from napi_get_frags() + napi_gro_frags() to napi_alloc_skb() + > napi_gro_receive() to disable local skb reusing (napi_reuse_skb()). > I also enabled GSO UDP L4 ("classic" one: one skbuff_head + frags) > for forwarding, not only local traffic, and disabled NF flow offload > to increase CPU loading and drop performance below link speed so I > could see the changes. > > So, the traffic flows looked like: > - TCP GRO (one head + frags) -> NAT -> hardware TSO; > - UDP GRO (one head + frags) -> NAT -> driver-side GSO. > > Baseline 5.11-rc3: > - 865 Mbps TCP, 866 Mbps UDP. > > This patch (both separate caches and Edward's unified cache): > - 899 Mbps TCP, 893 Mbps UDP. > > So that's cleary *not* only "pathological" UDP GRO Fraglists > "problem" as TCP also got ~35 Mbps from this, as well as > non-fraglisted UDP. > > Regarding latencies: I remember there were talks about latencies when > Edward introduced batched GRO (using linked lists to pass skbs from > GRO layer to core stack instead of passing one by one), so I think > it's a perennial question when it comes to batching/caching. > > Thanks for the feedback, will post v2 soon. > The question about if this caching is reasonable isn't closed anyway, > but I don't see significant "cons" for now. > Also it would be nice to have KASAN support. We do not want to unconditionally to recycle stuff, since this might hide use-after-free.