Messages in this thread | | | Date | Mon, 8 Apr 2013 08:07:41 -0700 | Subject | Re: [PATCH] [PATCH] Gaurantee spinlocks implicit barrier for !PREEMPT_COUNT | From | Linus Torvalds <> |
| |
On Mon, Apr 8, 2013 at 7:59 AM, Steven Rostedt <srostedt@redhat.com> wrote: >> +/* This is only a barrier to other asms. Notably get_user/put_user */ > > Probably should add in the comment: > > " or anything else that can cause a hidden schedule. " >
Fair enough. And I just remembered why I thought UP was special - we need to do the same thing about spinlocks, for the same reasons.
So that "asm_barrier()" should probably be in <linux/compiler.h> along with the "normal" barrier() definition.
*AND* somebody should re-check the gcc documentation on "volatile asm". I'm pretty sure it used to say "not moved significantly, including against each other" or something like that, but the gcc asm docs have changed over time.
I'd hate to have to add a memory clobber to the get_user/put_user asms, because that would *really* hurt. But maybe we could add some other clobber ("cc" or similar) to make sure they can't be re-ordered if the "volatile" isn't sufficient to make sure asms don't get re-ordered wrt each other.
Linus
| |