From patchwork Thu Jun 22 20:57:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Abeni X-Patchwork-Id: 779709 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wtwgC1H5Gz9s7B for ; Fri, 23 Jun 2017 08:07:35 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wtwgC0PgQzDrGH for ; Fri, 23 Jun 2017 08:07:35 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wtv5y5GbVzDq8c for ; Fri, 23 Jun 2017 06:57:10 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAE3E7F413; Thu, 22 Jun 2017 20:57:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BAE3E7F413 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pabeni@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BAE3E7F413 Received: from ovpn-116-57.ams2.redhat.com (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 348C05D96A; Thu, 22 Jun 2017 20:57:07 +0000 (UTC) Message-ID: <1498165026.2503.21.camel@redhat.com> Subject: Re: DNS (?) not working on G5 (64-bit powerpc) (was [net-next,v3,3/3] udp: try to avoid 2 cache miss on dequeue) From: Paolo Abeni To: Michael Ellerman Date: Thu, 22 Jun 2017 22:57:06 +0200 In-Reply-To: <87shisqihz.fsf@concordia.ellerman.id.au> References: <87shisqihz.fsf@concordia.ellerman.id.au> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 22 Jun 2017 20:57:08 +0000 (UTC) X-Mailman-Approved-At: Fri, 23 Jun 2017 07:46:23 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Eric Dumazet , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, 2017-06-22 at 23:06 +1000, Michael Ellerman wrote: > Paolo wrote: > > when udp_recvmsg() is executed, on x86_64 and other archs, most skb > > fields are on cold cachelines. > > If the skb are linear and the kernel don't need to compute the udp > > csum, only a handful of skb fields are required by udp_recvmsg(). > > Since we already use skb->dev_scratch to cache hot data, and > > there are 32 bits unused on 64 bit archs, use such field to cache > > as much data as we can, and try to prefetch on dequeue the relevant > > fields that are left out. > > > > This can save up to 2 cache miss per packet. > > > > v1 -> v2: > > - changed udp_dev_scratch fields types to u{32,16} variant, > > replaced bitfiled with bool > > > > Signed-off-by: Paolo Abeni > > Acked-by: Eric Dumazet > > --- > > net/ipv4/udp.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++------ > > 1 file changed, 103 insertions(+), 11 deletions(-) > > This appears to break wget on one of my machines. > > Networking in general is working, I'm able to SSH in, but then I can't > do a wget. Can you please check if the following patch fixes the issue? Only compiled tested here. Thanks!!! diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 067a607..80d89fe 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1446,16 +1446,19 @@ static struct sk_buff *__first_packet_length(struct sock *sk,  {   struct sk_buff *skb;   - while ((skb = skb_peek(rcvq)) != NULL && -        udp_lib_checksum_complete(skb)) { - __UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, - IS_UDPLITE(sk)); - __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, - IS_UDPLITE(sk)); - atomic_inc(&sk->sk_drops); - __skb_unlink(skb, rcvq); - *total += skb->truesize; - kfree_skb(skb); + while ((skb = skb_peek(rcvq)) != NULL) { + if (udp_lib_checksum_complete(skb)) { + __UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, + IS_UDPLITE(sk)); + __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, + IS_UDPLITE(sk)); + atomic_inc(&sk->sk_drops); + __skb_unlink(skb, rcvq); + *total += skb->truesize; + kfree_skb(skb); + } else { + udp_set_dev_scratch(skb); + }   }   return skb;  }