Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760953AbZFKAvS (ORCPT ); Wed, 10 Jun 2009 20:51:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756408AbZFKAvK (ORCPT ); Wed, 10 Jun 2009 20:51:10 -0400 Received: from mga02.intel.com ([134.134.136.20]:11641 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756809AbZFKAvJ (ORCPT ); Wed, 10 Jun 2009 20:51:09 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,198,1243839600"; d="scan'208";a="523454056" Subject: Re: [PATCH 3/3] ring-buffer: add design document From: Huang Ying To: Steven Rostedt Cc: "linux-kernel@vger.kernel.org" , Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , Theodore Tso , Arnaldo Carvalho de Melo , Mathieu Desnoyers , Lai Jiangshan , "Martin J. Bligh" , Christoph Hellwig , Li Zefan , "H. Peter Anvin" , Hidetoshi Seto , Masami Hiramatsu In-Reply-To: <20090610195525.429316815@goodmis.org> References: <20090610195311.767699959@goodmis.org> <20090610195525.429316815@goodmis.org> Content-Type: text/plain Date: Thu, 11 Jun 2009 08:51:07 +0800 Message-Id: <1244681467.8361.654.camel@yhuang-dev.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 897 Lines: 25 On Thu, 2009-06-11 at 03:53 +0800, Steven Rostedt wrote: > + > +cmpxchg - hardware assisted atomic transaction that performs the following: > + > + A = B iff previous A == C > + > + R = cmpxchg(A, C, B) is saying that we replace A with B if and only if > + current A is equal to C, and we put the old (current) A into R > + > + R gets the previous A regardless if A is updated with B or not. > + > + To see if the update was successful a compare of R == C may be used. As far as I know, some architectures have no hardware assisted (NMI safe) cmpxchg. Is it OK to use cmpxchg in architecture-independent code? Best Regards, Huang Ying -- 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/