[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17911.14509.184728.839589@cargo.ozlabs.ibm.com>
Date: Wed, 14 Mar 2007 10:50:05 +1100
From: Paul Mackerras <paulus@...ba.org>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: Rusty Russell <rusty@...tcorp.com.au>,
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
Jeremy Fitzhardinge writes:
> Or do you mean that if you have:
>
> preempt_disable();
> use_my_percpu++;
> preempt_enable();
> // switch cpus
> preempt_disable();
> use_my_percpu++;
> preempt_enable();
>
> then it will still use the old pointer to use_my_percpu?
Yes. It can, and sometimes does. There's no way (that I know of) to
tell gcc "all my __thread variables might have moved to a different
address".
> In principle gcc could CSE the value of smp_processor_id() across a cpu
> change in the same way.
There it's easier to make gcc do what we want, because we can use a
barrier or a volatile. The difference is that smp_processor_id() is
ultimately the value of something, not the address of something. We
can tell gcc "values might have changed" but have no way to say
"addresses might have changed".
Paul.
-
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