Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3277473pxb; Tue, 12 Jan 2021 10:29:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzU4aOxRIdM5oc1/zzMp3eqtTGblkFL82XuGWBnx6cIlTc3RR2r6ssP1dUjwdj/INuchbXq X-Received: by 2002:a17:906:ae4e:: with SMTP id lf14mr113202ejb.310.1610476151717; Tue, 12 Jan 2021 10:29:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610476151; cv=none; d=google.com; s=arc-20160816; b=kZIG6DouJabYtvI9kzgnToe16lqoQjrK0SelhwkN4amWVUsbfBB8zS0FGU7+IENgRj svj6B4ecCKPEBlkElN/l46KzN0u2gbTw01WKY3nBmWwI9nBYUBXRWrCejDDg2IP6SQCU cgwlnGel9iI1pXt88YMTpUT083tOp+8BDhuCxCJdN5KeuUdlc5gUu4VwwWDJFzkUDmpa Wi/j2y0jp2UPWBjLrJag7n2OIL4wFj/Dml/WpJV9kcZlHvmSURPFJb0RrH54DzxCMiJp UZkJlwy1s/JOff3nD9NAnzhSUBuEi1slo49sfLPpfxN+WwslY0KG7ayYQ5BKsQrI0sOo OnuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=8n93bPOPZQTgDRmrlPkdqmVljXTeEe9OQ3MWPKXyrJI=; b=TWw8gjy9c4iiEgfVfF2fKZ4PH3LsWuu1Ffsc0sydydGSImaZTZzUpe9Pzgg3BYB2X7 VxZEB7xI8ZklGlBhllOu7AqRPpJ1j6601xsHBbgRe6iuqiekMyHL/6GlljCSNISmf5r4 feeht6xB5KaDIjrmeelARIpIsVvKwwmA8tPz7mHACGc0bdggahIbMrDWYdo0dNgCs/7n QxFOBsHMzGR9cH4xMTYGqe/reJ863dRr5eNjFtMrzxvfrrDKW0yTbK33xS8xTMKJcbUr FnXmTkn/wjo+2Mkz+TMjaLbabMiCzG0s9Td7qaLeroSyB42KawvlDNnixKyslZ961ovS A0nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=PBzyz6k5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si872928eji.120.2021.01.12.10.28.47; Tue, 12 Jan 2021 10:29:11 -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=@pm.me header.s=protonmail header.b=PBzyz6k5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392333AbhALS1L (ORCPT + 99 others); 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 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch 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