From: Tejun Heo <tj@kernel.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Fr??d??ric Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Rusty Russell <rusty@rustcorp.com.au>,
Christoph Lameter <cl@linux-foundation.org>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: percpu tree build warning
Date: Thu, 26 Nov 2009 00:12:01 +0900 [thread overview]
Message-ID: <4B0D4941.5010904@kernel.org> (raw)
In-Reply-To: <20091125134058.GA9097@elte.hu>
Hello,
11/25/2009 10:40 PM, Ingo Molnar wrote:
> And look at your own 'cleanup' patch - it changes the percpu name to
> 'cpu_dr7'. That results in nonsensical repetition:
>
> dr7 = &__get_cpu_var(cpu_dr7);
My whole argument can be compressed into "don't name a global symbol
dr7, no matter what it is".
The key problem is the artificial difference between static and
dynamic percpu variable accessors. The old way of prefixing from
accessors only works for symbol literals, so either we need another
identical set for dynamic ones without auto-prefixing or we end up
doing the repetition you mentioned above in much uglier way.
Option 1:
this_cpu_static_OP(dr7, ARG);
this_cpu_dynamic_OP(*allocated_ptr, ARG);
this_cpu_dynamic_OP(per_cpu_var(dr7), ARG);
Options 2:
this_cpu_OP(per_cpu_var(dr7), ARG);
BTW, option 2 is what we've been doing before the change. It's just
ugly and the prefix no longer provides much protection because users
outside of percpu code have to use per_cpu_var() which never was
supposed to go outside of percpu internal code. All it ends up doing
is providing false sense of address space isolation when there is
none.
DEFINE_*(NAME) defines a global symbol NAME in all other definition
macros. DEFINE_PER_CPU() does so too.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-11-25 15:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 10:42 linux-next: percpu tree build warning Stephen Rothwell
2009-11-25 10:50 ` Ingo Molnar
2009-11-25 11:14 ` Rusty Russell
2009-11-25 11:58 ` Ingo Molnar
2009-11-25 12:39 ` Tejun Heo
2009-11-25 12:31 ` Tejun Heo
2009-11-25 13:40 ` Ingo Molnar
2009-11-25 15:12 ` Tejun Heo [this message]
2009-11-26 22:16 ` Rusty Russell
2009-11-27 5:41 ` Ingo Molnar
2009-11-27 5:57 ` Tejun Heo
2009-11-27 6:20 ` Ingo Molnar
2009-11-27 6:31 ` Tejun Heo
2009-11-27 6:32 ` Tejun Heo
2009-11-28 9:51 ` Rusty Russell
2009-11-29 6:40 ` Ingo Molnar
2009-11-30 0:31 ` Rusty Russell
2009-11-25 13:24 ` [PATCH] x86: rename global percpu symbol dr7 to cpu_dr7 Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2009-11-12 6:45 linux-next: percpu tree build warning Stephen Rothwell
2009-11-12 15:16 ` Christoph Lameter
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=4B0D4941.5010904@kernel.org \
--to=tj@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=cl@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).