Re: [patch 1/2] infrastructure to debug (dynamic) objects

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Ingo Molnar <mingo@...>, Greg KH <greg@...>
Date: Saturday, March 1, 2008 - 7:44 am

On Sat, 1 Mar 2008, Andrew Morton wrote:

Yes, keeping track of such stuff from some random state is not really
a good idea.
 

Hey, I'm as much a cynic as you. It just bothered me to hack this
solely into the timer code with the knowledge that there are other
potential users lurking. 

And I want to have it in the timer code for a simple reason: Everytime
when the timer list code explodes due to some stupid timer_list user,
I'm the moron who has to apply hackery to help the users to identify
the root cause. This happened more than 5 times in the last 3 month
and I'm fed up with keeping my ugly debug hackery up to date and
instruct bug reporters how to use it. The delta to get down to the
cause of the problem in the example case is: 

      one mail versus five.
      zero patch vs. finding and updating the old version

I have better ways to waste my sparse leisure time :)

You can be sure, that I will add the specific debug code to other
parts of the kernel whenever I trap over a problem which smells like
the kfree'd or reinitialized timer wreckage.
 

Will do.


I did not bother with a dynamic register interface before getting some
feedback on the idea in general. Will do when there is some agreement
that this is a useful infrastructure in general.


Well, I'm lazy as hell and I found the debug_locks.h include already,
which was added for the same reason: not adding the include to all the
affected files in mm/

Btw. DEBUG_LOCK_ALLOC is a perfect candidate to move over to this as
the current code only detects locks held by the calling thread, while
debugobjects detects also a lock held by any owner.


The hash is not a randomized hash as one would expect. It's purely
generated from the object address to simplify the lookup during the
free check. So the power of 2 size is a good thing :) /me adds
comment.


Good point.
 

Same here. As usual I copied it from some other place assuming that it
was correct there. Will check.
 

Hehehe.

Thanks for the review,

       tglx
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/2] infrastructure to debug (dynamic) objects, Thomas Gleixner, (Sat Mar 1, 6:24 am)
Re: [patch 1/2] infrastructure to debug (dynamic) objects, Thomas Gleixner, (Sat Mar 1, 7:44 am)
Re: [patch 1/2] infrastructure to debug (dynamic) objects, Peter Zijlstra, (Sat Mar 1, 6:42 pm)
Re: [patch 1/2] infrastructure to debug (dynamic) objects, Thomas Gleixner, (Sun Mar 2, 6:06 am)