Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754649AbcKQRHx convert rfc822-to-8bit (ORCPT ); Thu, 17 Nov 2016 12:07:53 -0500 Received: from mga05.intel.com ([192.55.52.43]:21132 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754518AbcKQRHt (ORCPT ); Thu, 17 Nov 2016 12:07:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,506,1473145200"; d="scan'208";a="32432982" From: "Reshetova, Elena" To: Peter Zijlstra CC: David Windsor , Kees Cook , Greg KH , Will Deacon , Arnd Bergmann , Thomas Gleixner , "Ingo Molnar" , "H. Peter Anvin" , LKML , Alexei Starovoitov , Daniel Borkmann Subject: RE: [RFC][PATCH 2/7] kref: Add kref_read() Thread-Topic: [RFC][PATCH 2/7] kref: Add kref_read() Thread-Index: AQHSPp8xNqFGs6lR9EeBqDMncz0eH6DZp9cAgAAIWACAANc8gIAA3lqAgACT3QCAAOQVAIAAQc2AgAADroCAAACTUIAACisAgAAmZoA= Date: Thu, 17 Nov 2016 15:42:02 +0000 Message-ID: <2236FBA76BA1254E88B949DDB74E612B41C14177@IRSMSX102.ger.corp.intel.com> References: <20161114174446.486581399@infradead.org> <20161115073322.GC28248@kroah.com> <20161115080314.GD3142@twins.programming.kicks-ass.net> <20161116100925.GM3142@twins.programming.kicks-ass.net> <20161117083458.GZ3142@twins.programming.kicks-ass.net> <20161117124339.GC3117@twins.programming.kicks-ass.net> <2236FBA76BA1254E88B949DDB74E612B41C14089@IRSMSX102.ger.corp.intel.com> <20161117132206.GE3117@twins.programming.kicks-ass.net> In-Reply-To: <20161117132206.GE3117@twins.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 799 Lines: 15 > Even if we now find all occurrences of atomic_t used as refcounter > (which we cannot actually guarantee in any case unless someone > manually reads every line) and convert it to refcount_t, we still have > atomic_t type present and new usage of it as refount will crawl in. It > is just a matter of time IMO. >Improve tooling. The patterns shouldn't be _that_ hard to find. Once the tools are good, new code isn't a problem either. >Anything: atomic*_{{dec,sub}_and_test,{add,sub}_return,fetch_{add,sub}} >followed by a call_rcu()/free(). Does not find everything unfortunately. Even if you add to above atomic*_add_unless() and also things like schedule_work(), still I fear we aren't covering everything. What is worse, I don't think there is a mechanism to guarantee full coverage.