All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: John Stultz <john.stultz@linaro.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH 4/4] [RFC] ipv6: Fix for possible ipv6 seqlock deadlock
Date: Fri, 27 Sep 2013 07:47:12 +0200	[thread overview]
Message-ID: <20130927054712.GB6597@gmail.com> (raw)
In-Reply-To: <52448F0F.9050408@linaro.org>


* John Stultz <john.stultz@linaro.org> wrote:

> On 09/26/2013 12:30 PM, Eric Dumazet wrote:
> > 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)
> 
> Ah, thanks! Verified it resolves the warning as well, so I've changed my
> patch to use your suggestion.

Btw., is this a deadlock that could occur upstream? If yes then adding a 
Cc: <stable@kernel.org> tag might be warranted.

Thanks,

	Ingo

  reply	other threads:[~2013-09-27  5:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 18:34 [PATCH 0/4][RFC] Lockdep enablement for seqcount/seqlocks John Stultz
2013-09-26 18:34 ` [PATCH 1/4] [RFC] net: Explicitly initialize u64_stats_sync structures for lockdep John Stultz
2013-09-26 19:26   ` Eric Dumazet
2013-09-26 19:34     ` John Stultz
2013-09-26 19:39       ` John Stultz
2013-09-26 19:46         ` Eric Dumazet
2013-09-27  5:44     ` Ingo Molnar
2013-09-27  5:44       ` Ingo Molnar
2013-09-27  9:15       ` Eric Dumazet
2013-09-27  9:15         ` Eric Dumazet
2013-09-26 18:34 ` [PATCH 2/4] [RFC] seqcount: Add lockdep functionality to seqcount/seqlock structures John Stultz
2013-09-26 20:46   ` Steven Rostedt
2013-09-26 20:59     ` John Stultz
2013-09-26 18:34 ` [PATCH 3/4] [RFC] cpuset: Fix potential deadlock w/ set_mems_allowed John Stultz
2013-09-26 18:34 ` [PATCH 4/4] [RFC] ipv6: Fix for possible ipv6 seqlock deadlock John Stultz
2013-09-26 19:30   ` Eric Dumazet
2013-09-26 19:46     ` John Stultz
2013-09-27  5:47       ` Ingo Molnar [this message]
2013-09-27 16:00         ` John Stultz
2013-09-27 17:51           ` Eric Dumazet
2013-10-07 22:51 [PATCH 0/4] Lockdep enablement for seqcount/seqlocks (v2) John Stultz
2013-10-07 22:52 ` [PATCH 4/4] [RFC] ipv6: Fix for possible ipv6 seqlock deadlock John Stultz
2013-10-07 23:54   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130927054712.GB6597@gmail.com \
    --to=mingo@kernel.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=john.stultz@linaro.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.