From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 0/3] ipc subsystem refcounter conversions Date: Mon, 29 May 2017 01:39:04 -0700 Message-ID: <20170529083903.GA17735@infradead.org> References: <1487590189-18151-1-git-send-email-elena.reshetova@intel.com> <20170303162352.b6af1c0c3115b3f5f1e7aed3@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from bombadil.infradead.org ([65.50.211.133]:36049 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbdE2Ije (ORCPT ); Mon, 29 May 2017 04:39:34 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook Cc: Andrew Morton , Elena Reshetova , Peter Zijlstra , Greg KH , "Eric W. Biederman" , Ingo Molnar , Alexey Dobriyan , "Serge E. Hallyn" , arozansk@redhat.com, Davidlohr Bueso , Manfred Spraul , Christoph Hellwig , "axboe@kernel.dk" , James Bottomley , "x86@kernel.org" , Ingo Molnar , Arnd Bergmann , "David S. Miller" , Rik van Riel , linux-arch On Sat, May 27, 2017 at 12:58:14PM -0700, Kees Cook wrote: > FAST_REFCOUNT=n: use function-based refcount_t with cmpxvhg and > full-verification > FAST_REFCOUNT=y without arch-specific implementation: use atomic_t > with no verification (i.e. no functional change from now) > FAST_REFCOUNT=y with arch-specific implementation: use atomic_t with > overflow protection > > which means FAST_REFCOUNT would need to be default-on so that mm, > block, net users will remain happy. > > Does that sound reasonable? I'd rather turn the options around so that the atomic_t or fast arch implementations are the defaul. But either way it needs to be configurable. Once that is done we can spread refcount_t everywhere and everyone will be better off, if only for the documentation value of the type when they use the atomic_t based implementation. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:36049 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbdE2Ije (ORCPT ); Mon, 29 May 2017 04:39:34 -0400 Date: Mon, 29 May 2017 01:39:04 -0700 From: Christoph Hellwig Subject: Re: [PATCH 0/3] ipc subsystem refcounter conversions Message-ID: <20170529083903.GA17735@infradead.org> References: <1487590189-18151-1-git-send-email-elena.reshetova@intel.com> <20170303162352.b6af1c0c3115b3f5f1e7aed3@linux-foundation.org> 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: Andrew Morton , Elena Reshetova , Peter Zijlstra , Greg KH , "Eric W. Biederman" , Ingo Molnar , Alexey Dobriyan , "Serge E. Hallyn" , arozansk@redhat.com, Davidlohr Bueso , Manfred Spraul , Christoph Hellwig , "axboe@kernel.dk" , James Bottomley , "x86@kernel.org" , Ingo Molnar , Arnd Bergmann , "David S. Miller" , Rik van Riel , linux-arch , "kernel-hardening@lists.openwall.com" , LKML Message-ID: <20170529083904.Tca6sWwcBeZbdSI_omMalQXiSXAoZLxod-c96OFV0n8@z> On Sat, May 27, 2017 at 12:58:14PM -0700, Kees Cook wrote: > FAST_REFCOUNT=n: use function-based refcount_t with cmpxvhg and > full-verification > FAST_REFCOUNT=y without arch-specific implementation: use atomic_t > with no verification (i.e. no functional change from now) > FAST_REFCOUNT=y with arch-specific implementation: use atomic_t with > overflow protection > > which means FAST_REFCOUNT would need to be default-on so that mm, > block, net users will remain happy. > > Does that sound reasonable? I'd rather turn the options around so that the atomic_t or fast arch implementations are the defaul. But either way it needs to be configurable. Once that is done we can spread refcount_t everywhere and everyone will be better off, if only for the documentation value of the type when they use the atomic_t based implementation.