From: Steven Rostedt <rostedt@goodmis.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
richard -rw- weinberger <richard.weinberger@gmail.com>,
linux-kernel@vger.kernel.org, mingo@redhat.com,
torvalds@linux-foundation.org, srostedt@redhat.com,
tglx@linutronix.de, linux-tip-commits@vger.kernel.org
Subject: Re: [tip:core/urgent] WARN_ON_SMP(): Add comment to explain ({0;})
Date: Tue, 29 Mar 2011 07:36:43 -0400 [thread overview]
Message-ID: <1301398603.14261.262.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <20110328181855.GA6146@p183.telecom.by>
On Mon, 2011-03-28 at 21:18 +0300, Alexey Dobriyan wrote:
> On Mon, Mar 28, 2011 at 11:09:00AM -0400, Steven Rostedt wrote:
> > Geeze, I never expected such a fuss over a simple change ;)
>
> And it's still broken ;-)
>
> [spoiler space]
I didn't understand this "space" and never went down to look more.
Should have said "see below".
> WARN_ON_SMP(x) should expand to x, not 0.
No it should expand to zero, please READ THE COMMENT!
OK, it was not part of this patch, but it was in the patch that this
patch was added for.
+/*
+ * WARN_ON_SMP() is for cases that the warning is either
+ * meaningless for !SMP or may even cause failures.
+ * This is usually used for cases that we have
+ * WARN_ON(!spin_is_locked(&lock)) checks, as spin_is_locked()
+ * returns 0 for uniprocessor settings.
+ * It can also be used with values that are only defined
+ * on SMP:
+ *
+ * struct foo {
+ * [...]
+ * #ifdef CONFIG_SMP
+ * int bar;
+ * #endif
+ * };
+ *
+ * void func(struct foo *zoot)
+ * {
+ * WARN_ON_SMP(!zoot->bar);
+ *
+ * For CONFIG_SMP, WARN_ON_SMP() should act the same as WARN_ON(),
+ * and should be a nop and return false for uniprocessor.
+ *
+ * if (WARN_ON_SMP(x)) returns true only when CONFIG_SMP is set
+ * and x is true.
+ */
-- Steve
prev parent reply other threads:[~2011-03-29 11:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tip-ccd0d44fad38dc1bb4b26dcc7a30e9f2c3b36870@git.kernel.org>
2011-03-28 14:51 ` H. Peter Anvin
2011-03-28 14:56 ` richard -rw- weinberger
2011-03-28 14:58 ` H. Peter Anvin
2011-03-28 15:09 ` Steven Rostedt
2011-03-28 18:18 ` Alexey Dobriyan
2011-03-29 7:30 ` Ingo Molnar
[not found] ` <8fa65ade-2b9f-4f05-9b52-dfd770326f44@email.android.com>
2011-03-29 14:47 ` Steven Rostedt
2011-03-29 11:36 ` Steven Rostedt [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=1301398603.14261.262.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=adobriyan@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richard.weinberger@gmail.com \
--cc=srostedt@redhat.com \
--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
all inboxes | Powered by JetHome®