On Fri, 2007-06-08 at 19:37 +0200, Martin Peschke wrote:Peter Zijlstra wrote:On Fri, 2007-06-08 at 19:18 +0200, Martin Peschke wrote:Peter Zijlstra wrote:Right, the problem here is that you iterate over all_lock_classes onceOn Fri, 2007-06-08 at 19:00 +0200, Martin Peschke wrote:There is a small state machine calling percpu_alloc when users doPeter Zijlstra wrote:Who eventually calls percpu_alloc?I'm confused as to where the class->stat objects are initialised? Isstatic struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
that done in lock_stat_init()? If so, then you have a bug.
I assume this gets us class structures containing all zeros, doesn't it?
Then class->stat is zeros as well, which is handled by lib/statistics.
(In this case, data gathering hasn't been turned on yet, and statistic_inc()
and similar functions don't access other areas of struct statistic.)
echo state=on > /debug/statistics/lockdep/definition
So data gathering is off by default.
It might make sense to allow "state=on" as a default. Then allocation would
be done in the context of statistic_attach().
Contrary to what the name might suggest, it are not all possible
classes, just all active ones. So you'll only attach the classes which
have been used up until the init point. All other classes used later
will never be initialized.