lkml.org 
[lkml]   [2013]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bug: Use xchg() to update WARN_ON_ONCE() static variable
On Tue, Oct 15, 2013 at 04:25:40PM -0400, Steven Rostedt wrote:
> On Tue, 15 Oct 2013 22:18:48 +0200
> Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
>
> > How about just updating __warned without a cmpxchg. It's not that critical
> > if the update is not seen immediately to other CPUs. OTOH it's critical
> > that's it is visible immediately to the current CPU
>
> Well, I didn't use cmpxchg() I used xchg() which is actually quite
> faster.

Still, I doubt it's that cheap.

>
> >
> > I mean some warrning can be hard to reproduce and happen to some users
> > while staying for several kernel releases. If it's repetitive, the xchg
> > might impact the performance.
>
> But do we care about that? A WARN_ON() means the kernel (or hardware)
> is buggy. It should be fixed.

Sure it should, doesn't mean it is. I've seen warnings that stayed on my
boot for several releases with non responsive maintainers (fortunately now
it seems that is got fixed).

>
> But Andrew's ONCE() request is something we would want to avoid the
> xchg() every time.

We we use it yeah.

>
> >
> > I may be overly paranoid, but I think barrier() (so that at least
> > we don't recurse locally) alone would be better.
>
> Heh, Boris is giving me the same argument on IRC ;-)
>
> -- Steve


\
 
 \ /
  Last update: 2013-10-15 23:01    [W:0.036 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site