Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935739AbdGTJeL (ORCPT ); Thu, 20 Jul 2017 05:34:11 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32865 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933620AbdGTJeG (ORCPT ); Thu, 20 Jul 2017 05:34:06 -0400 Date: Thu, 20 Jul 2017 11:34:02 +0200 From: Ingo Molnar To: Andrew Morton Cc: Davidlohr Bueso , "Eric W. Biederman" , Elena Reshetova , linux-kernel@vger.kernel.org, peterz@infradead.org, gregkh@linuxfoundation.org, mingo@redhat.com, adobriyan@gmail.com, serge@hallyn.com, arozansk@redhat.com, keescook@chromium.org, Hans Liljestrand , David Windsor Subject: Re: [PATCH 1/3] ipc: convert ipc_namespace.count from atomic_t to refcount_t Message-ID: <20170720093402.55alnsgsodgs4mfk@gmail.com> References: <1499417992-3238-1-git-send-email-elena.reshetova@intel.com> <1499417992-3238-2-git-send-email-elena.reshetova@intel.com> <87bmottgo4.fsf@xmission.com> <20170719153546.37567fbf77861653172fa263@linux-foundation.org> <20170719225427.GD14395@linux-80c1.suse> <20170719155833.641a283467bf6b89a7d2e56b@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170719155833.641a283467bf6b89a7d2e56b@linux-foundation.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1513 Lines: 40 * Andrew Morton wrote: > On Wed, 19 Jul 2017 15:54:27 -0700 Davidlohr Bueso wrote: > > > On Wed, 19 Jul 2017, Andrew Morton wrote: > > > > >I do rather dislike these conversions from the point of view of > > >performance overhead and general code bloat. But I seem to have lost > > >that struggle and I don't think any of these are fastpath(?). > > > > Well, since we now have fd25d19 (locking/refcount: Create unchecked atomic_t > > implementation), performance is supposed to be ok. > > Sure, things are OK for people who disable the feature. So with the WIP fast-refcount series from Kees: [PATCH v6 0/2] x86: Implement fast refcount overflow protection I believe the robustness difference between optimized-refcount_t and full-refcount_t will be marginal. I.e. we'll be able to have both higher API safety _and_ performance. > But for people who want to enable the feature we really should minimize the cost > by avoiding blindly converting sites which simply don't need it: simple, safe, > old, well-tested code. Why go and slow down such code? Need to apply some > common sense here... It's old, well-tested code _for existing, sane parameters_, until someone finds a decade old bug in one of these with an insane parameters no-one stumbled upon so far, and builds an exploit on top of it. Only by touching all these places do we have a chance to improve things measurably in terms of reducing the probability of bugs. Thanks, Ingo