Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761640Ab0HFRww (ORCPT ); Fri, 6 Aug 2010 13:52:52 -0400 Received: from terminus.zytor.com ([198.137.202.10]:50522 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751813Ab0HFRwq (ORCPT ); Fri, 6 Aug 2010 13:52:46 -0400 Message-ID: <4C5C4AAB.3000606@zytor.com> Date: Fri, 06 Aug 2010 10:47:23 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: Jeremy Fitzhardinge CC: Konrad Rzeszutek Wilk , Linux Kernel Mailing List , Nick Piggin , Peter Zijlstra , Xen-devel , Avi Kivity , Jan Beulich Subject: Re: [Xen-devel] [PATCH RFC 03/12] x86/ticketlock: Use C for __ticket_spin_unlock References: <20100720153845.GA9122@phenom.dumpdata.com> <4C45CC02.7030603@goop.org> In-Reply-To: <4C45CC02.7030603@goop.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 923 Lines: 24 On 07/20/2010 09:17 AM, Jeremy Fitzhardinge wrote: > > "volatile" would be a compiler barrier, but it has no direct effect on, > or relevence to, the CPU. It just cares about the LOCK_PREFIX. The > "memory" clobber is probably unnecessary as well, since the constraints > already tell the compiler the most important information. We can add > barriers separately as needed. > You absolutely need volatile, since otherwise you're permitting the compiler to split, re-execute or even drop the code. Anything else might work, by accident, but it's not clean. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. -- 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/