lkml.org 
[lkml]   [2008]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [(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(&current->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





    \
     
     \ /
      Last update: 2008-02-26 01:55    [W:2.247 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site