From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760979Ab2EIUK3 (ORCPT ); Wed, 9 May 2012 16:10:29 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43806 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759545Ab2EIUK1 (ORCPT ); Wed, 9 May 2012 16:10:27 -0400 Message-ID: <4FAACF1C.2060504@zytor.com> Date: Wed, 09 May 2012 13:10:04 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: "Michael S. Tsirkin" CC: Andrew Morton , Rob Landley , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Arnd Bergmann , David Howells , Akinobu Mita , Alexey Dobriyan , Herbert Xu , Stephen Rothwell , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Gleb Natapov , Paolo Bonzini , kvm@vger.kernel.org, Avi Kivity , Marcelo Tosatti , Linus Torvalds Subject: Re: [PATCH] bitops: add _local bitops References: <20120509134528.GA18044@redhat.com> <20120509121940.459e93ba.akpm@linux-foundation.org> <20120509200735.GA22743@redhat.com> In-Reply-To: <20120509200735.GA22743@redhat.com> X-Enigmail-Version: 1.4.1 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 On 05/09/2012 01:07 PM, Michael S. Tsirkin wrote: > > In practice ATM any of the above will work. We probably don't even need > to add barrier() calls since what we do afterwards is apic access which > has an optimization barrier anyway. But I'm fine with adding them in > there just in case if that's what people want. > If you have the optimization barrier anyway, then I'd be fine with you just using __test_and_clear_bit() and add to a comment in arch/x86/include/asm/bitops.h that KVM needs it to be locally atomic. -hpa