From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C609C43381 for ; Tue, 12 Jan 2021 18:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F206E2311D for ; Tue, 12 Jan 2021 18:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392511AbhALS1L (ORCPT ); Tue, 12 Jan 2021 13:27:11 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:24719 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390350AbhALS1K (ORCPT ); Tue, 12 Jan 2021 13:27:10 -0500 Date: Tue, 12 Jan 2021 18:26:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610475986; bh=8n93bPOPZQTgDRmrlPkdqmVljXTeEe9OQ3MWPKXyrJI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=PBzyz6k5GbGYVRRkn0uPUXUBtgqGvUCXdEZonPgRpVNdgFKHd0nbklw+1uZvoU8DS V8pK/x/9H6Gkh4C4IR3Ql+Yx497sVBWXnyQa6O11/hNu+uAL06u8rCrJOQFjSUil77 NDPU8bJ5oRvWrG/g5bqTeNrifhZcVbN5MSarRKvveYKCS/wDDDdhsw6aSJ+wp4oVAo gH3wLBZh800jwgqrA2nEz1AYNohWr6/uljB72l8Dbzd/g9zq3R48Muqc7yF61UfJ8n fEfJ8qnN1u6ua2A+o0gXw5PRIyEcNu+ZOQhdbaT0xeALdi2ss4CqDXwEDFI3mz0Xpg +RgZ42r1OLRiQ== To: Eric Dumazet From: Alexander Lobakin Cc: Alexander Lobakin , "David S. Miller" , Jakub Kicinski , Edward Cree , Jonathan Lemon , Willem de Bruijn , Miaohe Lin , Steffen Klassert , Guillaume Nault , Yadu Kishore , Al Viro , netdev , LKML Reply-To: Alexander Lobakin Subject: Re: [PATCH net-next 0/5] skbuff: introduce skbuff_heads bulking and reusing Message-ID: <20210112182601.154198-1-alobakin@pm.me> In-Reply-To: References: <20210111182655.12159-1-alobakin@pm.me> <20210112105529.3592-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > So I would try first to make this case better, instead of trying to > work around the real issue. Al