From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754209Ab3IZTav (ORCPT ); Thu, 26 Sep 2013 15:30:51 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:37648 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049Ab3IZTau (ORCPT ); Thu, 26 Sep 2013 15:30:50 -0400 Message-ID: <1380223848.3165.207.camel@edumazet-glaptop> Subject: Re: [PATCH 4/4] [RFC] ipv6: Fix for possible ipv6 seqlock deadlock From: Eric Dumazet To: John Stultz Cc: LKML , Mathieu Desnoyers , Steven Rostedt , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy Date: Thu, 26 Sep 2013 12:30:48 -0700 In-Reply-To: <1380220464-28840-5-git-send-email-john.stultz@linaro.org> References: <1380220464-28840-1-git-send-email-john.stultz@linaro.org> <1380220464-28840-5-git-send-email-john.stultz@linaro.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-09-26 at 11:34 -0700, John Stultz wrote: > While enabling lockdep on seqlocks, I ran accross the warning below > caused by the ipv6 stats being updated in both irq and non-irq context. > > This is a novice attempt to correct the issue, and with this patch > the warning goes away. Any better solutions would be appreciated! ... > > out_err_release: > - if (err == -ENETUNREACH) > + if (err == -ENETUNREACH) { > + unsigned long flags; > + /* some of the stats are locked in irq context */ > + local_irq_save(flags); > IP6_INC_STATS_BH(net, NULL, IPSTATS_MIB_OUTNOROUTES); > + local_irq_restore(flags); > + } > dst_release(*dst); > *dst = NULL; > return err; You better change IP6_INC_STATS_BH() to IP6_INC_STATS() On x86 for example, no extra code will be generated (no need to disable hard or soft irqs)