From: Josh Triplett <josh@joshtriplett.org>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: paulmck@linux.vnet.ibm.com, laijs@cn.fujitsu.com,
manfred@colorfullife.com, dhowells@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu: avoid checking for constant
Date: Wed, 11 Jan 2012 23:14:31 -0800 [thread overview]
Message-ID: <20120112071431.GA1896@leaf> (raw)
In-Reply-To: <1326345104-6919-1-git-send-email-jengelh@medozas.de>
On Thu, Jan 12, 2012 at 06:11:44AM +0100, Jan Engelhardt wrote:
> When compiling kernel or module code with -O0, "offset" is no longer
> considered a constant, and therefore always triggers the build error
> that BUILD_BUG_ON is defined to yield.
>
> What is the rationale between the forced constant check,
> introduced in 9ab1544eb4196ca8d05c433b2eb56f74496b1ee3?
[...]
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -805,8 +805,6 @@ void __kfree_rcu(struct rcu_head *head, unsigned long offset)
> {
> typedef void (*rcu_callback)(struct rcu_head *);
>
> - BUILD_BUG_ON(!__builtin_constant_p(offset));
> -
> /* See the kfree_rcu() header comment. */
> BUILD_BUG_ON(!__is_kfree_rcu_offset(offset));
The very next check after the one you removed will break if the
compiler can't check the offset at compile time.
- Josh Triplett
next prev parent reply other threads:[~2012-01-12 7:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 5:11 [PATCH] rcu: avoid checking for constant Jan Engelhardt
2012-01-12 7:14 ` Josh Triplett [this message]
2012-01-12 9:25 ` Jan Engelhardt
2012-01-12 9:52 ` Josh Triplett
2012-01-12 10:34 ` Jan Engelhardt
2012-01-12 10:54 ` Eric Dumazet
2012-01-12 10:57 ` Jan Engelhardt
2012-01-12 15:29 ` Paul E. McKenney
2012-01-12 16:08 ` Jan Engelhardt
2012-01-12 16:14 ` Eric Dumazet
2012-01-12 11:58 ` Josh Triplett
2012-01-12 15:38 ` Jan Engelhardt
2012-01-12 18:41 ` Josh Triplett
2012-04-19 18:57 ` Paul E. McKenney
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=20120112071431.GA1896@leaf \
--to=josh@joshtriplett.org \
--cc=dhowells@redhat.com \
--cc=jengelh@medozas.de \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=paulmck@linux.vnet.ibm.com \
/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