public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Peschke <mp3@de.ibm.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-kernel@vger.kernel.org, jbaron@redhat.com,
	rostedt@goodmis.org, billh@gnuppy.monkey.org, mingo@elte.hu,
	linux-s390@vger.kernel.org
Subject: Re: [RFC] [Patch 4/4] lock contention tracking slimmed down
Date: Mon, 11 Jun 2007 12:31:52 +0200	[thread overview]
Message-ID: <466D2498.3000105@de.ibm.com> (raw)
In-Reply-To: <1181325030.5728.14.camel@lappy>

Peter Zijlstra wrote:
> 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:
>>>>> On Fri, 2007-06-08 at 19:00 +0200, Martin Peschke wrote:
>>>>>> Peter Zijlstra wrote:
>>>>>>> I'm confused as to where the class->stat objects are initialised? Is
>>>>>>> that done in lock_stat_init()? If so, then you have a bug.
>>>>>> static struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
>>>>>>
>>>>>> 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.)
>>>>> Who eventually calls percpu_alloc?
>>>> There is a small state machine calling percpu_alloc when users do
>>>>
>>>>     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().
>>> Right, the problem here is that you iterate over all_lock_classes once
>>> at init.
>>>
>>> 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.

One could work around this by iterating over the entire array...

Anyway, this is not good enough. The right solution was to teach my
code to deal with static (per-cpu) statistic counter arrays in addition
to buffers allocated with percpu_alloc(). Both use cases are valid.

Thanks for your feedback.

Martin


  reply	other threads:[~2007-06-11 10:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 21:34 [RFC] [Patch 4/4] lock contention tracking slimmed down Martin Peschke
2007-06-06 23:06 ` Ingo Molnar
2007-06-07  0:17   ` Martin Peschke
2007-06-07  4:40     ` Bill Huey
2007-06-07  7:03       ` Martin Peschke
2007-06-07  7:30         ` Ingo Molnar
2007-06-07  8:56           ` Bill Huey
2007-06-11 11:26             ` Martin Peschke
2007-06-08 16:27           ` Martin Peschke
2007-06-07  6:39     ` Peter Zijlstra
2007-06-07  6:59       ` Martin Peschke
2007-06-07  7:27         ` Ingo Molnar
2007-06-08 16:07           ` Martin Peschke
2007-06-06 23:10 ` Ingo Molnar
2007-06-07  0:21   ` Martin Peschke
2007-06-07  7:44 ` Peter Zijlstra
2007-06-08 17:00   ` Martin Peschke
     [not found]     ` <1181322460.5728.2.camel@lappy>
     [not found]       ` <46698F7F.4090407@de.ibm.com>
2007-06-08 17:27         ` Peter Zijlstra
2007-06-08 17:37           ` Martin Peschke
2007-06-08 17:50             ` Peter Zijlstra
2007-06-11 10:31               ` Martin Peschke [this message]
2007-06-07  7:51 ` Peter Zijlstra
2007-06-08 17:13   ` Martin Peschke
2007-06-07  8:17 ` Peter Zijlstra
2007-06-07 10:21   ` Ingo Molnar
2007-06-11 12:20   ` Martin Peschke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466D2498.3000105@de.ibm.com \
    --to=mp3@de.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=billh@gnuppy.monkey.org \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox