From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934801AbcCONSA (ORCPT ); Tue, 15 Mar 2016 09:18:00 -0400 Received: from casper.infradead.org ([85.118.1.10]:55191 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbcCONRw (ORCPT ); Tue, 15 Mar 2016 09:17:52 -0400 Date: Tue, 15 Mar 2016 14:17:48 +0100 From: Peter Zijlstra To: Ingo Molnar 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: <20160315131748.GY6344@twins.programming.kicks-ass.net> References: <20160314123200.GA15971@gmail.com> <20160315093245.GA7943@gmail.com> <20160315120147.GA9742@gmail.com> <20160315123253.GA10152@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160315123253.GA10152@gmail.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 15, 2016 at 01:32:53PM +0100, Ingo Molnar wrote: > So if we are still on the same page at this point, we'd have to add a pointer > variant too I suspect: > > cmpxchg_ptr() > xchg_ptr() We typically call those _long(), like atomic_long_t etc.. Under the assumption that sizeof(long) == sizeof(void *). Also, _IF_ we're going to do this, this is the perfect opportunity to also introduce the __atomic address space and load() and store() operations. This is needed for architectures where: cmpxchg()/xchg() isn't safe against regular stores, like all those who implement atomics using hashed spinlocked. Its going to be a horrid lot of work though :/