lkml.org 
[lkml]   [2014]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 10/11] qspinlock: Paravirt support
    On Wed, Jun 18, 2014 at 02:03:12PM +0200, Paolo Bonzini wrote:
    > Il 17/06/2014 00:08, Waiman Long ha scritto:
    > >>+void __pv_queue_unlock(struct qspinlock *lock)
    > >>+{
    > >>+ int val = atomic_read(&lock->val);
    > >>+
    > >>+ native_queue_unlock(lock);
    > >>+
    > >>+ if (val & _Q_LOCKED_SLOW)
    > >>+ ___pv_kick_head(lock);
    > >>+}
    > >>+
    > >
    > >Again a race can happen here between the reading and writing of the lock
    > >value. I can't think of a good way to do that without using cmpxchg.
    >
    > Could you just use xchg on the locked byte?

    I'll have to, indeed. This is racy.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2014-07-07 19:01    [W:4.098 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site