From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486Ab3K1VBp (ORCPT ); Thu, 28 Nov 2013 16:01:45 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:44236 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750901Ab3K1VBn (ORCPT ); Thu, 28 Nov 2013 16:01:43 -0500 Message-ID: <1385672502.5352.38.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [PATCH] inet: further fixes of possible seqlock deadlocks From: Eric Dumazet To: Hannes Frederic Sowa Cc: jongman.heo@samsung.com, David Miller , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Thu, 28 Nov 2013 13:01:42 -0800 In-Reply-To: <20131128192231.GE24171@order.stressinduktion.org> References: <13025162.118881385612276530.JavaMail.weblogic@epv6ml01> <1385659390.5352.20.camel@edumazet-glaptop2.roam.corp.google.com> <1385661082.5352.34.camel@edumazet-glaptop2.roam.corp.google.com> <20131128192231.GE24171@order.stressinduktion.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2013-11-28 at 20:22 +0100, Hannes Frederic Sowa wrote: > This fixes more incorrect uses of *_STATS_BH in process context. > > Cc: Eric Dumazet > Signed-off-by: Hannes Frederic Sowa > --- > net/ipv4/udp.c | 8 ++++---- > net/ipv6/ip6_output.c | 8 ++++---- > net/ipv6/ping.c | 4 ++-- > 3 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c > index 44e3884..f5cc018 100644 > --- a/net/ipv4/udp.c > +++ b/net/ipv4/udp.c > @@ -1160,10 +1160,10 @@ static unsigned int first_packet_length(struct sock *sk) > spin_lock_bh(&rcvq->lock); Here we block BH, because of spin_lock_bh() > while ((skb = skb_peek(rcvq)) != NULL && > udp_lib_checksum_complete(skb)) { > - UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, > - IS_UDPLITE(sk)); > - UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, > - IS_UDPLITE(sk)); So this is the right thing, this change is not needed. > + UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_CSUMERRORS, > + IS_UDPLITE(sk)); > + UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, > + IS_UDPLITE(sk)); > atomic_inc(&sk->sk_drops); > __skb_unlink(skb, rcvq); > __skb_queue_tail(&list_kill, skb); > diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c > index 59df872..e05cf0a 100644 > --- a/net/ipv6/ip6_output.c > +++ b/j > @@ -116,8 +116,8 @@ static int ip6_finish_output2(struct sk_buff *skb) > } > rcu_read_unlock_bh(); > > - IP6_INC_STATS_BH(dev_net(dst->dev), > - ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES); > + IP6_INC_STATS(dev_net(dst->dev), > + ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES); This is ipv6, not inet changes ;) > kfree_skb(skb); > return -EINVAL; > } > @@ -1524,8 +1524,8 @@ int ip6_push_pending_frames(struct sock *sk) > if (proto == IPPROTO_ICMPV6) { > struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); > > - ICMP6MSGOUT_INC_STATS_BH(net, idev, icmp6_hdr(skb)->icmp6_type); > - ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS); > + ICMP6MSGOUT_INC_STATS(net, idev, icmp6_hdr(skb)->icmp6_type); > + ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTMSGS); I am not sure we use a seqlock for ICMP stats. seqlocks were used for 64bit IP stats