[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <53A18000.8080909@redhat.com>
Date: Wed, 18 Jun 2014 14:03:12 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Waiman Long <waiman.long@...com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: tglx@...utronix.de, mingo@...nel.org, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
xen-devel@...ts.xenproject.org, kvm@...r.kernel.org,
paolo.bonzini@...il.com, konrad.wilk@...cle.com,
boris.ostrovsky@...cle.com, paulmck@...ux.vnet.ibm.com,
riel@...hat.com, torvalds@...ux-foundation.org,
raghavendra.kt@...ux.vnet.ibm.com, david.vrabel@...rix.com,
oleg@...hat.com, gleb@...hat.com, scott.norton@...com,
chegu_vinod@...com, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 10/11] qspinlock: Paravirt support
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?
Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists