Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp565953pxb; Wed, 25 Aug 2021 09:33:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXCpSKWWb2yYCdT8VzQwJisAYocF2JKdufZTTr+qc+dkuzhkyrj5fnEF6uDKjVD22m/SJZ X-Received: by 2002:a17:907:2126:: with SMTP id qo6mr19182705ejb.476.1629909234063; Wed, 25 Aug 2021 09:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629909234; cv=none; d=google.com; s=arc-20160816; b=wMr/+CVMQ1MIXShn62xHf7ZMdZKH5A3oVXQvpbQl3oPAoFUSfubMiZJshKIROhH1mt trpq8ALnIBL3UcxcwfL64CFNR7WMcJCs55EW8CCl7Plxm0a1X3AlLqK4I8Wmtuhtzt64 PcOtHjspISO8MbtIhQzMurFIJvWLDddx00yNuCU6i7kov/l/E9Fbxww3vfH8RbZyQpvG aRb8azuG8tBp3RX1IR51OVtUELh//dFcvqmflHIDqvh/Zxdq1ppN3tMt87LKda46/Ypn 8dOrEyXiN6LPAY9+XWF9TIr/o8B0Zl0aS/wkCMH6OlCNG+zi0YGKs1la32sNosAd0HUv A1Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=sqeNXGhA3cye1rsmvOQ8m1ijfc+DLpUpqgAU3WM7aN4=; b=NU0JFL4MbNspI0yleXaqxG6myLHBmEJtIIaGurxquSPF4BxXzOvDZ760vWrR8x8Ehq 0Nb6WDCKBJShj0FznoDa+9UbU047/5jV+XLN+n7vI4vyyBFHZynLmE/xwMTJg20asBdS 19xf/0j7wT5972vsb0XGjdXawRBmNHaEh1n3W94eIYPXpSSnPrCUdJ6Xm9IYXj+PewU1 KU01QjCV7EKHdPLflsfO7RkOLY22C9SRebYUJerC6VHNdGeJIUjil1W/2IvJ2GNOhfeQ JoujWzf6DiBREpf4x57HYVLXWRdsONUaFtrpylqIThmqht56LVHGBubWInbCN6dYIsjB 9tNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OrbxUpYE; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si461125edd.224.2021.08.25.09.33.29; Wed, 25 Aug 2021 09:33:54 -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=@gmail.com header.s=20161025 header.b=OrbxUpYE; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240473AbhHYQaC (ORCPT + 99 others); Wed, 25 Aug 2021 12:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239665AbhHYQ37 (ORCPT ); Wed, 25 Aug 2021 12:29:59 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9DFC0613CF; Wed, 25 Aug 2021 09:29:12 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id c17so302907pgc.0; Wed, 25 Aug 2021 09:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sqeNXGhA3cye1rsmvOQ8m1ijfc+DLpUpqgAU3WM7aN4=; b=OrbxUpYEIiu7NIfew3ajuAEX9jeRcQHAr8imiwkrrbpLS2G/1fk8hZ6sBYyJuQRTid h/06Awkk2XomH/y33/Ohuvr0tBJ7wR+So1xBFDCsCjUIn8rJrsE4Mp0YPuBzqWN2A1Mr XN1QnZNArYu+ptSfUEcxQc1DJLBBENz2VNVUB92jV8IkRnpWYxDKnMbXknwkmbZzyo6+ xKS5hyPUKGMAEIAwYTgv8PHWx5zy9m618JBlJ9ofKy4MxxKYORtbbL/Xd4+zUBn4Cey/ KYtI6w+Rgoxpx1xujAEfGRMYiBczvdY8zuKpr6ZnejX5FLaOrFYtFMjVNTNvPcXQYt1z /D7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sqeNXGhA3cye1rsmvOQ8m1ijfc+DLpUpqgAU3WM7aN4=; b=jJFsnwACOr36Vx8TJPA3avqf8T0rTXadFwHEYifjNJBSeiy4O5o4sR0yHiwkpC8o15 DQb0s1Tw+POJh6WGycMQSVDZVwb/DiPOsH5Qq3AgNAN14d/dQDq3zogJxGA3BiXKiqG9 a2gFv6mLm6pP7MP0RiOG43ETtaBbk8/wuNkoB0UsjCx78dN5Wnah+jMmsTR9a8jXGdBU RknjbAsUHf1ejEgnE0FhNld2vhfCBbVKiIRh5ALaYAMC5RGy3/s6kqqqd8ANkl4At6P1 sCFIp4VwGz3nTw7620eIrnCps2naKBWZ8x9LJ6YbjO8dx7HTEv44jWIzx65qjgVujXZd 39pw== X-Gm-Message-State: AOAM531xSmSRDPUVWbOrABVPpZwzu0N7dcqo8s2Ds+f/zJas0Qe8vK9y +/hxvF8tI2YXPCKr8+giqOo= X-Received: by 2002:aa7:8d11:0:b0:3ef:9c79:405d with SMTP id j17-20020aa78d11000000b003ef9c79405dmr3832497pfe.72.1629908952097; Wed, 25 Aug 2021 09:29:12 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([8.45.42.119]) by smtp.googlemail.com with ESMTPSA id a66sm300826pfa.59.2021.08.25.09.29.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 09:29:11 -0700 (PDT) Subject: Re: [Linuxarm] Re: [PATCH RFC 0/7] add socket to netdev page frag recycling support To: Eric Dumazet , Yunsheng Lin Cc: David Miller , Jakub Kicinski , Alexander Duyck , Russell King , Marcin Wojtas , linuxarm@openeuler.org, Yisen Zhuang , Salil Mehta , Thomas Petazzoni , Jesper Dangaard Brouer , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrew Morton , Peter Zijlstra , Will Deacon , Matthew Wilcox , Vlastimil Babka , Fenghua Yu , Roman Gushchin , Peter Xu , "Tang, Feng" , Jason Gunthorpe , mcroce@microsoft.com, Hugh Dickins , Jonathan Lemon , Alexander Lobakin , Willem de Bruijn , wenxu , Cong Wang , Kevin Hao , Aleksandr Nogikh , Marco Elver , Yonghong Song , kpsingh@kernel.org, Andrii Nakryiko , Martin KaFai Lau , Song Liu , netdev , LKML , bpf , chenhao288@hisilicon.com, Hideaki YOSHIFUJI , David Ahern , memxor@gmail.com, linux@rempel-privat.de, Antoine Tenart , Wei Wang , Taehee Yoo , Arnd Bergmann , Mat Martineau , aahringo@redhat.com, ceggers@arri.de, yangbo.lu@nxp.com, Florian Westphal , xiangxia.m.yue@gmail.com, linmiaohe , Christoph Hellwig References: <1629257542-36145-1-git-send-email-linyunsheng@huawei.com> <2cf4b672-d7dc-db3d-ce90-15b4e91c4005@huawei.com> <4b2ad6d4-8e3f-fea9-766e-2e7330750f84@huawei.com> From: David Ahern Message-ID: <5fdc5223-7d67-fed7-f691-185dcb2e3d80@gmail.com> Date: Wed, 25 Aug 2021 09:29:06 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/23/21 8:04 AM, Eric Dumazet wrote: >> >> >> It seems PAGE_ALLOC_COSTLY_ORDER is mostly related to pcp page, OOM, memory >> compact and memory isolation, as the test system has a lot of memory installed >> (about 500G, only 3-4G is used), so I used the below patch to test the max >> possible performance improvement when making TCP frags twice bigger, and >> the performance improvement went from about 30Gbit to 32Gbit for one thread >> iperf tcp flow in IOMMU strict mode, > > This is encouraging, and means we can do much better. > > Even with SKB_FRAG_PAGE_ORDER set to 4, typical skbs will need 3 mappings > > 1) One for the headers (in skb->head) > 2) Two page frags, because one TSO packet payload is not a nice power-of-two. interesting observation. I have noticed 17 with the ZC API. That might explain the less than expected performance bump with iommu strict mode. > > The first issue can be addressed using a piece of coherent memory (128 > or 256 bytes per entry in TX ring). > Copying the headers can avoid one IOMMU mapping, and improve IOTLB > hits, because all > slots of the TX ring buffer will use one single IOTLB slot. > > The second issue can be solved by tweaking a bit > skb_page_frag_refill() to accept an additional parameter > so that the whole skb payload fits in a single order-4 page. > >