Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755479AbcKOHrP (ORCPT ); Tue, 15 Nov 2016 02:47:15 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36074 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbcKOHrO (ORCPT ); Tue, 15 Nov 2016 02:47:14 -0500 Date: Tue, 15 Nov 2016 08:47:03 +0100 From: Peter Zijlstra To: Greg KH Cc: Christoph Hellwig , keescook@chromium.org, will.deacon@arm.com, elena.reshetova@intel.com, arnd@arndb.de, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, dave@progbits.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 2/7] kref: Add kref_read() Message-ID: <20161115074703.GK3142@twins.programming.kicks-ass.net> References: <20161114173946.501528675@infradead.org> <20161114174446.486581399@infradead.org> <20161114181655.GA21516@infradead.org> <20161115072855.GB28248@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161115072855.GB28248@kroah.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 802 Lines: 17 On Tue, Nov 15, 2016 at 08:28:55AM +0100, Greg KH wrote: > On Mon, Nov 14, 2016 at 10:16:55AM -0800, Christoph Hellwig wrote: > > On Mon, Nov 14, 2016 at 06:39:48PM +0100, Peter Zijlstra wrote: > > > Since we need to change the implementation, stop exposing internals. > > > > > > Provide kref_read() to read the current reference count; typically > > > used for debug messages. > > > > Can we just provide a printk specifier for a kref value instead as > > that is the only valid use case for reading the value? > > Yeah, that would be great as no one should be doing anything > logic-related based on the kref value. IIRC there are a few users that WARN_ON() the value with a minimum bound or somesuch. Those would be left in the cold, but yes I too like the idea of a printk() format specifier.