Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1662362pxb; Mon, 12 Apr 2021 03:47:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrk0Wrtsv5KxKu+yDK7ixwY0291qlLmL/vZHr4AbHDmuoRnxDMUT92URbLjVFKEJ/nJdiS X-Received: by 2002:a17:90a:9405:: with SMTP id r5mr12394167pjo.139.1618224435645; Mon, 12 Apr 2021 03:47:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618224435; cv=none; d=google.com; s=arc-20160816; b=vXutnYdnLNLhJCCkWSXuolGn/7wB5M7VvYGaXTx6YQwidORcyGOMB0HcTNIC4lRRKQ w+vgViFL1y0CoHBoMAAGhDHHuQGXhEnU0OLtgmxy0aqp++u0SQxdZilX2axLBrIL3fzM pLeSApsHivM4yXLh6CQmnY6W53IsDcB0XPBxpRQ5dDA2MzZV3T0b073wtimFqCM5rM4g igUrMiD2iG8Oo2l5cq/PuNkKUk3JLUHgPIA0I90MkpEoh/vIoa9X3UNMa4p/63zMOW6M xDaURBf1GyNyUvQjjiaSKf2ih2/iLLL+fxylMEYeXq5r8zEOnGLkV4XNUmnwHPRu7wIj SCMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Md2Zxi5mlK6A0SJTQ0HAHiot58gOc3Ewp3sbKgTkdmw=; b=Ll6P4GMYVZw0Ump4xB8CL42HbglLjXLY7UuvGGS40V8Yse76/dMejZCWJjsuPhNqHP WeAq655/fmwDmtKs4uNx/1As96YydkEnslV0p54eqiC8mfmEglIWXnOcWT0rRu8we/zC /zxTytepMaYHhK0+kv0P+PlE+OR6xpVJFPt4e/lR0mHyfaVRgpeka2ymx+ptXJZomTt/ heuN249aHiexLtBpHKLOVFiDO5WYdehqMHIR8x5usPkA/nC64Qc3iaer/epUKp5EoiFt puMV+OEKNJGnGSXjeJZcrej+ZwTeLx2nZ7FtvhSHFmM0GY+Vm4GoddQFcFuFSp5i0vHm 1HnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uZy2CKXy; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 63si13108184pge.586.2021.04.12.03.47.03; Mon, 12 Apr 2021 03:47:15 -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=@linuxfoundation.org header.s=korg header.b=uZy2CKXy; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239637AbhDLKpi (ORCPT + 99 others); Mon, 12 Apr 2021 06:45:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:49558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239062AbhDLKph (ORCPT ); Mon, 12 Apr 2021 06:45:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 374F36134F; Mon, 12 Apr 2021 10:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618224319; bh=/yFjMUiGPFNWMalqJeYQqR6ZQK8rTlZ0JOYyZI10Zdc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uZy2CKXyxIM6LSMKsoGOrwjzJ/dzK4T3EygMvD1b5iY/Y9IS6+Iws23AYOEqSIrj6 OdpJPAmBiJdx7juSCPSIRT56CER2Da7apU5bnf2PxfAHx9gY1c0uUPdOpivELFu2Mg eOOyS9JYEFqX0MDAtR5HdMr2QM1flv+b/ucccMOc= Date: Mon, 12 Apr 2021 12:45:16 +0200 From: Greg Kroah-Hartman To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Xuan Zhuo , Eric Dumazet , Jason Wang , virtualization@lists.linux-foundation.org, "David S. Miller" Subject: Re: [PATCH 5.10 055/188] virtio_net: Do not pull payload in skb->head Message-ID: References: <20210412084013.643370347@linuxfoundation.org> <20210412084015.479443671@linuxfoundation.org> <20210412051010-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210412051010-mutt-send-email-mst@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 12, 2021 at 05:11:40AM -0400, Michael S. Tsirkin wrote: > On Mon, Apr 12, 2021 at 10:39:29AM +0200, Greg Kroah-Hartman wrote: > > From: Eric Dumazet > > > > commit 0f6925b3e8da0dbbb52447ca8a8b42b371aac7db upstream. > > > > Xuan Zhuo reported that commit 3226b158e67c ("net: avoid 32 x truesize > > under-estimation for tiny skbs") brought a ~10% performance drop. > > > > The reason for the performance drop was that GRO was forced > > to chain sk_buff (using skb_shinfo(skb)->frag_list), which > > uses more memory but also cause packet consumers to go over > > a lot of overhead handling all the tiny skbs. > > > > It turns out that virtio_net page_to_skb() has a wrong strategy : > > It allocates skbs with GOOD_COPY_LEN (128) bytes in skb->head, then > > copies 128 bytes from the page, before feeding the packet to GRO stack. > > > > This was suboptimal before commit 3226b158e67c ("net: avoid 32 x truesize > > under-estimation for tiny skbs") because GRO was using 2 frags per MSS, > > meaning we were not packing MSS with 100% efficiency. > > > > Fix is to pull only the ethernet header in page_to_skb() > > > > Then, we change virtio_net_hdr_to_skb() to pull the missing > > headers, instead of assuming they were already pulled by callers. > > > > This fixes the performance regression, but could also allow virtio_net > > to accept packets with more than 128bytes of headers. > > > > Many thanks to Xuan Zhuo for his report, and his tests/help. > > > > Fixes: 3226b158e67c ("net: avoid 32 x truesize under-estimation for tiny skbs") > > Reported-by: Xuan Zhuo > > Link: https://www.spinics.net/lists/netdev/msg731397.html > > Co-Developed-by: Xuan Zhuo > > Signed-off-by: Xuan Zhuo > > Signed-off-by: Eric Dumazet > > Cc: "Michael S. Tsirkin" > > Cc: Jason Wang > > Cc: virtualization@lists.linux-foundation.org > > Acked-by: Jason Wang > > Signed-off-by: David S. Miller > > Signed-off-by: Greg Kroah-Hartman > > > > Note that an issue related to this patch was recently reported. > It's quite possible that the root cause is a bug elsewhere > in the kernel, but it probably makes sense to defer the backport > until we know more ... Thanks, I'll go drop it from all 4 queues. If you all find out that all is good, and it should be added back, please let us at stable@vger know about it. thanks, greg k-h