opensubscriber
   Find in this group all groups
 
Linux-Kernel more information…

l : linux-kernel@vger.kernel.org 26 February 2008 • 8:45AM -0500

Re: [(RT RFC) PATCH v2 3/9] rearrange rt_spin_lock sleep
by Gregory Haskins

REPLY TO AUTHOR
 
REPLY TO GROUP




>>> On Mon, Feb 25, 2008 at  4:54 PM, in message
<20080225215454.GF2659@elf....>, Pavel Machek <pavel@ucw....> 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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger...
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.