From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Ingo Molnar <mingo@elte.hu>,
Tejun Heo <tj@kernel.org>, Mike Travis <travis@sgi.com>,
Christoph Lameter <cl@linux-foundation.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Subject: Re: [PATCH] unbreak alpha percpu
Date: Tue, 14 Apr 2009 09:45:56 +0200 [thread overview]
Message-ID: <20090414094556.3af71358@skybase> (raw)
In-Reply-To: <alpine.LFD.2.00.0904100915010.4583@localhost.localdomain>
On Fri, 10 Apr 2009 09:21:08 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> Hmm. I certainly personally _much_ prefer this version.
>
> It looks like this actually simplifies things for S390 too (no more
> simple_identifier_##var games), and generally just looks better. And
> seeing that the S390 special case is no longer S390-specific is also a
> good sign, imho.
>
> Sorry for including the whole message, but I'm adding s390 and percpu
> people to the cc. Guys - original uncorrupted patch on lkml.
> > diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
> > index 408d60b..6a71d73 100644
> > --- a/arch/s390/include/asm/percpu.h
> > +++ b/arch/s390/include/asm/percpu.h
> > @@ -13,20 +13,18 @@
> > */
> > #if defined(__s390x__) && defined(MODULE)
> >
> > -#define SHIFT_PERCPU_PTR(ptr,offset) (({ \
> > - extern int simple_identifier_##var(void); \
> > +#define SHIFT_PERCPU_PTR(var,offset) (({ \
> > unsigned long *__ptr; \
> > asm ( "larl %0, %1@GOTENT" \
> > - : "=a" (__ptr) : "X" (ptr) ); \
> > - (typeof(ptr))((*__ptr) + (offset)); }))
> > + : "=a" (__ptr) : "X" (&per_cpu_var(var)) ); \
> > + (typeof(&per_cpu_var(var)))((*__ptr) + (offset)); }))
> >
> > #else
> >
> > -#define SHIFT_PERCPU_PTR(ptr, offset) (({ \
> > - extern int simple_identifier_##var(void); \
> > +#define SHIFT_PERCPU_PTR(var, offset) (({ \
> > unsigned long __ptr; \
> > - asm ( "" : "=a" (__ptr) : "0" (ptr) ); \
> > - (typeof(ptr)) (__ptr + (offset)); }))
> > + asm ( "" : "=a" (__ptr) : "0" (&per_cpu_var(var)) ); \
> > + (typeof(&per_cpu_var(var))) (__ptr + (offset)); }))
> >
> > #endif
> >
I would like to get rid of that SHIFT_PERCPU_PTR mess. The patch from
Ivan will allow this, it uses a dummy variable to void the effect of a
static modifier for percpu variables in modules. The percpu variable
itself will be defined non-static, my gut feeling is that this is a
dirty little trick that might bite us in the future.
Another solution which I personally would prefer is to ban the use of
static percpu variables. Then the compiler will use the GOT to get the
address of percpu variables without any dirty tricks.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2009-04-14 7:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-10 15:12 [PATCH] unbreak alpha percpu Al Viro
2009-04-10 15:47 ` Al Viro
2009-04-10 16:21 ` Linus Torvalds
2009-04-10 16:50 ` Al Viro
2009-04-10 17:05 ` Al Viro
2009-04-10 17:14 ` Al Viro
2009-04-10 18:05 ` Ivan Kokshaysky
2009-04-10 18:20 ` Linus Torvalds
2009-04-10 18:43 ` Tejun Heo
2009-04-10 19:02 ` Tejun Heo
2009-04-10 19:34 ` Ingo Molnar
2009-04-10 19:40 ` [GIT PULL] percpu + mutex fixes Ingo Molnar
2009-04-16 10:21 ` Al Viro
2009-04-14 7:45 ` Martin Schwidefsky [this message]
2009-04-14 9:01 ` [PATCH] unbreak alpha percpu Tejun Heo
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=20090414094556.3af71358@skybase \
--to=schwidefsky@de.ibm.com \
--cc=cl@linux-foundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=travis@sgi.com \
--cc=viro@ZenIV.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.