From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753503Ab1LLRms (ORCPT ); Mon, 12 Dec 2011 12:42:48 -0500 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]:35666 "EHLO mail-lpp01m010-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203Ab1LLRmp (ORCPT ); Mon, 12 Dec 2011 12:42:45 -0500 Message-ID: <1323711754.2583.14.camel@edumazet-laptop> Subject: Re: [PATCH] kref: add function for reading kref value From: Eric Dumazet To: Daniel Baluta Cc: Greg KH , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, adobriyan@gmail.com Date: Mon, 12 Dec 2011 18:42:34 +0100 In-Reply-To: References: <1323693892-11570-1-git-send-email-dbaluta@ixiacom.com> <20111212150255.GA7506@kroah.com> <1323703934.1765.15.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <1323704494.1765.17.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1- 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 Le lundi 12 décembre 2011 à 18:42 +0200, Daniel Baluta a écrit : > Yes, but you have to do this each time you start debugging, for a > particular referenced counted object. > What a big deal. > We must find a clever solution to avoid the noise. (e.g use > /proc, /sysfs, /debugfs options to trigger dumping info for > some/all objects with a certain state). > > Usecase: > > At some point we need to know all objects with refcount X, > and their history of get/put operations. > > For us it would have been very useful when debugging dev > refcnts problems. With the current implementation kernel > only dumped info at dev.c:5429: > current on your git repo maybe, not on ours :( > printk(KERN_EMERG "unregister_netdevice: " > waiting for %s to become free. Usage " > count = %d\n", > dev->name, atomic_read(&dev->refcnt)); > This is a very good example where you _cannot_ use kref, since we now use a percpu refcnt fot netdevice.