From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:45516 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953AbdIDTfj (ORCPT ); Mon, 4 Sep 2017 15:35:39 -0400 Date: Mon, 4 Sep 2017 21:35:27 +0200 From: Peter Zijlstra Subject: Re: [tip:locking/core] locking/refcount: Create unchecked atomic_t implementation Message-ID: <20170904193527.GB17526@worktop.programming.kicks-ass.net> References: <20170621200026.GA115679@beast> <20170904123724.5trepllnd25r4uyt@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook Cc: "David S. Miller" , Arnd Bergmann , Manfred Spraul , Rik van Riel , "H. Peter Anvin" , Eric Biggers , "Reshetova, Elena" , David Windsor , Ingo Molnar , Jann Horn , "Serge E. Hallyn" , Alexey Dobriyan , Greg KH , "Eric W. Biederman" , Hans Liljestrand , Thomas Gleixner , Christoph Hellwig , Josh Poimboeuf , LKML , Linus Torvalds , Andrew Morton , Davidlohr Bueso , linux-arch , James Bottomley , "linux-tip-commits@vger.kernel.org" Message-ID: <20170904193527.XnjLrseF1CiNcaOFbLQE-cwRd4XrssbcTihtS6c3dHE@z> On Mon, Sep 04, 2017 at 10:11:37AM -0700, Kees Cook wrote: > On Mon, Sep 4, 2017 at 5:37 AM, Peter Zijlstra wrote: > > On Wed, Jun 28, 2017 at 09:58:15AM -0700, tip-bot for Kees Cook wrote: > >> locking/refcount: Create unchecked atomic_t implementation > > > > This seems to do only half the job. Here's the rest. > > > > --- > > Subject: locking/refcount: Finish unchecked atomic_t implementation > > > > For some reason the unchecked atomic_t implementation stopped half-way > > through, complete it it. > > Hmm? The reason is that the implementation of the remaining functions > is unchanged between full, unchecked, and x86. But they're wasted code if !arch because the existing atomic functions are adequate (and I would argue better in case of atomic_add_unless). And arch implementations would certainly want to reimplement dec_not_one. Plus, you completely failed mention any of this.