lkml.org 
[lkml]   [2010]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/20] x86/ticketlock: make __ticket_spin_trylock common
On 11/13/2010 02:48 AM, Eric Dumazet wrote:
> Le samedi 13 novembre 2010 à 18:17 +0800, Américo Wang a écrit :
>> On Wed, Nov 03, 2010 at 10:59:47AM -0400, Jeremy Fitzhardinge wrote:
>>
>>> + union {
>>> + struct __raw_tickets tickets;
>>> + __ticketpair_t slock;
>>> + } tmp, new;
>>> + int ret;
>>> +
>>> + tmp.tickets = ACCESS_ONCE(lock->tickets);
>>> + if (tmp.tickets.head != tmp.tickets.tail)
>>> + return 0;
>>> +
>>> + new.slock = tmp.slock + (1 << TICKET_SHIFT);
>>> +
>>> + ret = cmpxchg(&lock->ticketpair, tmp.slock, new.slock) == tmp.slock;
>>> + barrier(); /* just make nothing creeps before lock is claimed */
>> This one should be smp_wmb(), right? No CONFIG_X86_OOSTORE protected.
> cmpxchg() is a full memory barrier, no need for smp_wmb() or barrier()

Agreed.

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

\
 
 \ /
  Last update: 2010-11-15 20:41    [W:0.078 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site