|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH 06/20] x86/ticketlock: make __ticket_spin_trylock
To: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx> |
Subject: |
[Xen-devel] Re: [PATCH 06/20] x86/ticketlock: make __ticket_spin_trylock common |
From: |
Américo Wang <xiyou.wangcong@xxxxxxxxx> |
Date: |
Sat, 13 Nov 2010 18:17:32 +0800 |
Cc: |
Nick Piggin <npiggin@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Srivatsa Vaddagiri <vatsa@xxxxxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>, Linux Virtualization <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Avi Kivity <avi@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx> |
Delivery-date: |
Mon, 15 Nov 2010 01:22:47 -0800 |
Dkim-signature: |
v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=Z8OiFjVu8j1ru7U04taAxiNwvxMJ6Epg94wpyVUot+Y=; b=R/SC0h2A2J/0VcTdzEoDltu9FYMD4K+xivO9Wle5cf+T9L4oLTcz8aWd0fNiRY19cf XmYuNS95byJmKDOjooPTRbQ6QRFDxXLTvQAH4wWgiiG13+xjjxR1GEKhkpLrpv/moUp6 znd96jnSrvWepfzU484sxzdxOKIVKlpwG1WhM= |
Domainkey-signature: |
a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=xAQjf6LmAPEUeBIWLO58TkLIR8TtEEJHaC2e0yW+gMywGLIXY0qnAX6U2Y4PabFKi6 2PXoj+5mOocgxFjXCCLTWCw0EjW9R6P6R1OPmwBa78g3rNckko3EKmmgD6q8jgxEuaDM HS4V2bXAJTy86vjptSS8UEVZvkImLse2mSND4= |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<4cea7b0804de5a2c1249034fc5c4840ade043ff4.1288794124.git.jeremy.fitzhardinge@xxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<cover.1288794124.git.jeremy.fitzhardinge@xxxxxxxxxx> <4cea7b0804de5a2c1249034fc5c4840ade043ff4.1288794124.git.jeremy.fitzhardinge@xxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
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.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|