Messages in this thread | | | Date | Mon, 25 Feb 2008 17:45:07 -0700 | From | "Gregory Haskins" <> | Subject | Re: [(RT RFC) PATCH v2 3/9] rearrange rt_spin_lock sleep |
| |
>>> On Mon, Feb 25, 2008 at 4:54 PM, in message <20080225215454.GF2659@elf.ucw.cz>, Pavel Machek <pavel@ucw.cz> wrote: > Hi! > >> @@ -720,7 +728,8 @@ rt_spin_lock_slowlock(struct rt_mutex *lock) >> * saved_state accordingly. If we did not get a real wakeup >> * then we return with the saved state. >> */ >> - saved_state = xchg(¤t->state, TASK_UNINTERRUPTIBLE); >> + saved_state = current->state; >> + smp_mb(); >> >> for (;;) { >> unsigned long saved_flags; > > Please document what the barrier is good for.
Yeah, I think you are right that this isn't needed. I think that is a relic from back when I was debugging some other problems. Let me wrap my head around the implications of removing it, and either remove it or document appropriately.
> > Plus, you are replacing atomic operation with nonatomic; is that ok?
Yeah, I think so. We are substituting a write with a read, and word reads are always atomic anyway IIUC (or is that only true on certain architectures)? Note that we are moving the atomic-write to be done later in the update_current() calls.
-Greg
| |