[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1173834769.5443.3.camel@localhost.localdomain>
Date: Wed, 14 Mar 2007 12:12:49 +1100
From: Rusty Russell <rusty@...tcorp.com.au>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: Paul Mackerras <paulus@...ba.org>,
Andi Kleen <andi@...stfloor.org>,
Marcin 'Qrczak' Kowalczyk <qrczak@....org.pl>,
linux-kernel@...r.kernel.org
Subject: Re: _proxy_pda still makes linking modules fail
On Tue, 2007-03-13 at 08:31 -0700, Jeremy Fitzhardinge wrote:
> Paul Mackerras wrote:
> > There is a fundamental problem with using __thread, which is that gcc
> > assumes that the addresses of __thread variables are constant within
> > one thread, and that therefore it can cache the result of address
> > calculations. However, with preempt, threads in the kernel can't rely
> > on staying on one cpu, and therefore the addresses of per-cpu
> > variables can change. There appears to be no way to tell gcc to drop
> > all cached __thread variable address calculations at a given point
> > (e.g. when enabling or disabling preemption). That is basically why I
> > gave up on using __thread for per-cpu variables on powerpc.
[ Thanks for the enlightenment, Paul ]
> Doesn't that fall under the general class of "you have to be pinned to a
> particular cpu in order to meaningfully use per-cpu variables"?
No, it makes assumptions about the *address* of a per-cpu variable not
changing, even across barriers.
> In principle gcc could CSE the value of smp_processor_id() across a cpu
> change in the same way.
No, this is why preempt_enable and the like are memory barriers.
Rusty.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists