From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124Ab3LRTid (ORCPT ); Wed, 18 Dec 2013 14:38:33 -0500 Received: from mga11.intel.com ([192.55.52.93]:31819 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805Ab3LRTib (ORCPT ); Wed, 18 Dec 2013 14:38:31 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,508,1384329600"; d="scan'208";a="452185866" From: Andi Kleen To: Linus Torvalds Cc: Paul McKenney , Waiman Long , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , "linux-arch\@vger.kernel.org" , "the arch\/x86 maintainers" , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andrew Morton , Michel Lespinasse , Rik van Riel , Raghavendra K T , George Spelvin , Tim Chen , Aswin Chandramouleeswaran , Scott J Norton Subject: Re: [PATCH v7 1/4] qrwlock: A queue read/write lock implementation References: <1385147087-26588-1-git-send-email-Waiman.Long@hp.com> <1385147087-26588-2-git-send-email-Waiman.Long@hp.com> <20131217192128.GA15969@linux.vnet.ibm.com> Date: Wed, 18 Dec 2013 11:38:29 -0800 In-Reply-To: (Linus Torvalds's message of "Tue, 17 Dec 2013 11:27:29 -0800") Message-ID: <878uvilzka.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > > In this case, we seem to want the xadd() semantics. I guess we can use > "atomic_add_return(val,&atomic)-val" and just assume that the compiler > gets it right (with the addition and the subtraction cancelling out). It can't, as we use inline assembler. In theory it could with __sync_* or __atomic_* intrinsics but we traditionally don't use them as they don't support patchable LOCK (maybe it would be time to get rid of the patchable LOCK though?) -Andi -- ak@linux.intel.com -- Speaking for myself only