Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751598AbdFHG6P (ORCPT ); Thu, 8 Jun 2017 02:58:15 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:46085 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbdFHG6N (ORCPT ); Thu, 8 Jun 2017 02:58:13 -0400 Date: Wed, 7 Jun 2017 23:58:09 -0700 From: Christoph Hellwig To: Kees Cook Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Peter Zijlstra , "Eric W. Biederman" , Andrew Morton , Josh Poimboeuf , Jann Horn , Eric Biggers , Elena Reshetova , Hans Liljestrand , David Windsor , Greg KH , Ingo Molnar , Alexey Dobriyan , "Serge E. Hallyn" , arozansk@redhat.com, Davidlohr Bueso , Manfred Spraul , "axboe@kernel.dk" , James Bottomley , "x86@kernel.org" , Ingo Molnar , Arnd Bergmann , "David S. Miller" , Rik van Riel , linux-arch Subject: Re: [PATCH v2] refcount: Create unchecked atomic_t implementation Message-ID: <20170608065809.GC14568@infradead.org> References: <20170608025831.GA43608@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170608025831.GA43608@beast> User-Agent: Mutt/1.8.0 (2017-02-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1003 Lines: 18 On Wed, Jun 07, 2017 at 07:58:31PM -0700, Kees Cook wrote: > Many subsystems will not use refcount_t unless there is a way to build the > kernel so that there is no regression in speed compared to atomic_t. This > adds CONFIG_REFCOUNT_FULL to enable the full refcount_t implementation > which has the validation but is slightly slower. When not enabled, > refcount_t uses the basic unchecked atomic_t routines, which results in > no code changes compared to just using atomic_t directly. > > Signed-off-by: Kees Cook > --- > This is v2 of this patch, which I've split from the arch-specific > alternative implementation for x86. Getting this patch in will unblock > atomic_t -> refcount_t conversion, and the x86 alternative implementation > can be developed in parallel. Changes from v1: use better atomic ops, > thanks to Elena and Peter. Yeah, can we get this in ASAP? Without having to always incur the over this will allow us to convert subsystems to refcount_t broadly.