From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934711AbcCOMIw (ORCPT ); Tue, 15 Mar 2016 08:08:52 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35570 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934328AbcCOMIn (ORCPT ); Tue, 15 Mar 2016 08:08:43 -0400 Date: Tue, 15 Mar 2016 13:08:35 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Linus Torvalds , Linux Kernel Mailing List , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH] atomic: Fix bugs in 'fetch_or()' and rename it to 'xchg_or()' Message-ID: <20160315120835.GA3232@gmail.com> References: <20160314123200.GA15971@gmail.com> <20160315093245.GA7943@gmail.com> <20160315105008.GT6344@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160315105008.GT6344@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > On Tue, Mar 15, 2016 at 10:32:45AM +0100, Ingo Molnar wrote: > > 2) its naming sucks. "fetch_or()" does not really signal that it's a > > fundamentally atomic operation, nor what API family it belongs to. > > I disagree there, the fetch-$op naming is widely used for atomic > operations that return the previous value. See for example the C/C++11 > atomic ops. The problem I see is that we don't really have the fetch_*() naming in the kernel right now, while we do have the xchg_*() naming. The latter is 'obviously' an atomic operation - while 'fetch' could be anything. No strong opinion, but I think fetch_or() is not a particularly good name. Thanks, Ingo