Re: Question on debugging reference counts on Net devices.

2005-09-02 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] Date: Mon, 29 Aug 2005 16:01:11 -0700 Latest netdevice ref-count debugging patch is up. The patch is against 2.6.13: http://www.candelatech.com/oss/rfcnt.patch I reviewed this, and I think the approach can be refined and made more

Re: Question on debugging reference counts on Net devices.

2005-09-02 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Thu, 01 Sep 2005 23:11:28 -0700 A quick optimization is to kmalloc chunks of 1000 or so structs at once and then write a cheap foomalloc method to grab and release them. We already take a lock (at least in my implementation), so this should be small

Re: Question on debugging reference counts on Net devices.

2005-09-02 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] Date: Thu, 01 Sep 2005 23:11:28 -0700 A quick optimization is to kmalloc chunks of 1000 or so structs at once and then write a cheap foomalloc method to grab and release them. We already take a lock (at least in my implementation), so

Re: Question on debugging reference counts on Net devices.

2005-09-02 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] All the list stuff gets compiled out unless we're debugging. So this netdev_pointer degenerates into a fancy pointer. We can use a struct list_head to avoid the unlink complexity. Ok, glad to see it can be compiled away as needed.

Re: Question on debugging reference counts on Net devices.

2005-09-02 Thread Ben Greear
After some sleep, I have an idea: Is there any reason we couldn't create a method: void dev_hold_ref(struct dbg_dev_rfcnt_info* i, netdevice* dev, void* key); This would be virtual identical to the __debug_dev_hold(netdevice* dev, void* key) that I currently have, but it would use the

Re: Question on debugging reference counts on Net devices.

2005-09-02 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Fri, 02 Sep 2005 09:35:59 -0700 Is there any reason we couldn't create a method: void dev_hold_ref(struct dbg_dev_rfcnt_info* i, netdevice* dev, void* key); Please strongly consider my netdev_pointer idea, and drop this dynamically allocated

Re: Question on debugging reference counts on Net devices.

2005-09-01 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Mon, 29 Aug 2005 16:01:11 -0700 Latest netdevice ref-count debugging patch is up. The patch is against 2.6.13: http://www.candelatech.com/oss/rfcnt.patch I reviewed this, and I think the approach can be refined and made more robust. The worst part

Re: Question on debugging reference counts on Net devices.

2005-08-29 Thread Ben Greear
Latest netdevice ref-count debugging patch is up. The patch is against 2.6.13: http://www.candelatech.com/oss/rfcnt.patch DaveM: Please let me know what you think about including this for 2.6.14. Also, I was thinking we could probably always compile for this feature but leave it disabled

Re: Question on debugging reference counts on Net devices.

2005-08-29 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Mon, 29 Aug 2005 16:01:11 -0700 DaveM: Please let me know what you think about including this for 2.6.14. It'll take me a day or so to get back to this as I'm currently getting net-2.6.14 merged into Linus's tree (some 240+ patches). - To unsubscribe

Re: Question on debugging reference counts on Net devices.

2005-08-28 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] Date: Sat, 27 Aug 2005 11:19:24 -0700 Although my implementation is not there yet, it would be nice if we could use the address of the pointer than holds the dev reference as the key. We should then be able to also catch double

Re: Question on debugging reference counts on Net devices.

2005-08-28 Thread jamal
On Sun, 2005-28-08 at 01:19 -0700, Ben Greear wrote: Here's an updated patch (git working better now, thanks!): http://www.candelatech.com/oss/rfcnt.patch I started a list of constants #defined in netdevice.h. These will be used for all stack variable references and other places where I

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Fri, 26 Aug 2005 16:43:29 -0700 Btw, I think I found a leaked reference off in the ATM code...does this look legit to you? Definitely, that reference is leaked. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] Date: Fri, 26 Aug 2005 16:43:29 -0700 Btw, I think I found a leaked reference off in the ATM code...does this look legit to you? Definitely, that reference is leaked. Ok, I have the beginnings of my attempt at reference count

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Sat, 27 Aug 2005 01:23:25 -0700 I'm still learning git...I had to post filter that patch to get rid of of the many diff --git lines that didn't seem to help much. The timestamps of the files are stored in the git index, so if they are different for

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Sat, 27 Aug 2005 01:23:25 -0700 The more interesting parts of the patch is below. The basic idea is to pass a key in when you hold or put a device. This key matches puts with holds. #defined macros grab the file name and line number for printing out

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] Date: Sat, 27 Aug 2005 01:23:25 -0700 The more interesting parts of the patch is below. The basic idea is to pass a key in when you hold or put a device. This key matches puts with holds. #defined macros grab the file name and line

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Sat, 27 Aug 2005 11:19:24 -0700 Although my implementation is not there yet, it would be nice if we could use the address of the pointer than holds the dev reference as the key. We should then be able to also catch double dereferences and places where

Re: Question on debugging reference counts on Net devices.

2005-08-27 Thread Ben Greear
David S. Miller wrote: From: Ben Greear [EMAIL PROTECTED] Date: Sat, 27 Aug 2005 11:19:24 -0700 Although my implementation is not there yet, it would be nice if we could use the address of the pointer than holds the dev reference as the key. We should then be able to also catch double

Re: Question on debugging reference counts on Net devices.

2005-08-26 Thread Ben Greear
In dev.c's process_backlog, there is code like this: dev = skb-dev netif_receive_skb(skb); dev_put(dev); Do you happen to know what piece of code takes this reference to the device in the first place? Also, why not make the

Re: Question on debugging reference counts on Net devices.

2005-08-26 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Fri, 26 Aug 2005 16:34:49 -0700 And for the record, I grepped a great deal of dev_holds, but associating a particular get with a put is making my head hurt :) How about the one, and only one, in that file that adds the SKBs to the input_pkt_queue list?

Re: Question on debugging reference counts on Net devices.

2005-08-24 Thread David S. Miller
From: Ben Greear [EMAIL PROTECTED] Date: Wed, 24 Aug 2005 10:14:22 -0700 I was thinking about somehow instrumenting dev_get and dev_put (and __dev_get and __dev_put, I suppose) to keep a list of all that have got and put, but that will be very invasive and time consuming I fear... That's how