From: Frederic Weisbecker <fweisbec@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"H. Peter Anvin" <hpa@linux.intel.com>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
"Liu, Chuansheng" <chuansheng.liu@intel.com>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH] bug: Use xchg() to update WARN_ON_ONCE() static variable
Date: Tue, 15 Oct 2013 22:37:16 +0200 [thread overview]
Message-ID: <20131015203715.GC3269@localhost.localdomain> (raw)
In-Reply-To: <20131015162540.5275728a@gandalf.local.home>
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
prev parent reply other threads:[~2013-10-15 20:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 19:58 [PATCH] bug: Use xchg() to update WARN_ON_ONCE() static variable Steven Rostedt
2013-10-15 20:12 ` Andrew Morton
2013-10-15 20:21 ` Frederic Weisbecker
2013-10-15 20:36 ` Steven Rostedt
2013-10-15 20:41 ` Frederic Weisbecker
2013-10-15 20:35 ` Steven Rostedt
2013-10-15 20:18 ` Frederic Weisbecker
2013-10-15 20:25 ` Steven Rostedt
2013-10-15 20:37 ` Frederic Weisbecker [this message]
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=20131015203715.GC3269@localhost.localdomain \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=chuansheng.liu@intel.com \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox