From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933831AbeEWRSt (ORCPT ); Wed, 23 May 2018 13:18:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51964 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933741AbeEWRSq (ORCPT ); Wed, 23 May 2018 13:18:46 -0400 Date: Wed, 23 May 2018 19:18:17 +0200 From: Peter Zijlstra To: Mark Rutland Cc: linux-kernel@vger.kernel.org, Boqun Feng , Will Deacon , Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Palmer Dabbelt , Albert Ou Subject: Re: [PATCH 00/13] atomics: API cleanups Message-ID: <20180523171817.GV12198@hirez.programming.kicks-ass.net> References: <20180523133533.1076-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180523133533.1076-1-mark.rutland@arm.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 02:35:20PM +0100, Mark Rutland wrote: > This series contains a few cleanups of the atomic API, fixing an > inconsistency between atomic_* and atomic64_*, and minimizing repetition > in arch code. This is nicer for arch code, and the improved regularity > will help when generating the atomic headers in future. > > The bulk of the patches reorganise things so architectures consistently > provide _fetch_add_unless(), with atomic_fetch_add_unless() > provided as a wrapper by core code. A generic fallback is provided for > _fetch_add_unless(), based on _read() and > _try_cmpxchg(). > > Other patches in the series add common fallbacks for: > > * atomic64_inc_not_zero() > * _inc_and_test() > * _dec_and_test() > * _sub_and_test() > * add_negative() > > ... as almost all architectures provide identical implementation of > these today. > > The end result is a strongly negative diffstat, though > grows by a reasonable amount. When we generate the headers, we can halve > this by templating the various fallbacks for atomic{,64}_t. > Thanks for this Mark, Acked-by: Peter Zijlstra (Intel) Ingo, can you magic this into tip somewhere?