From: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, h.mitake@gmail.com,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jens Axboe <jens.axboe@oracle.com>,
Jason Baron <jbaron@redhat.com>,
Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Subject: Re: [PATCH] perf lock: Fix state machine to recognize lock sequence
Date: Wed, 21 Apr 2010 18:12:06 +0900 [thread overview]
Message-ID: <4BCEC166.50207@dcl.info.waseda.ac.jp> (raw)
In-Reply-To: <20100421012651.GC7120@nowhere>
On 04/21/10 10:26, Frederic Weisbecker wrote:
> On Fri, Apr 16, 2010 at 05:44:06PM +0900, Hitoshi Mitake wrote:
>> Hi Ingo,
>>
>> I'm developing the model to recognize the correct sequence of lock
events.
>> Previous state machine of perf lock was really broken.
>> This patch improves it a little.
>>
>> This patch prepares the array of state machine represents lock
sequence for each threads.
>> These state machines represent one of these sequence:
>>
>> 1) acquire -> acquired -> release
>> 2) acquire -> contended -> acquired -> release
>> 3) acquire (w/ try) -> release
>> 4) acquire (w/ read) -> release
>>
>> The case of 4) is a little special.
>> Double acquire of read lock is allowed, so state machine of sequence
>> counts read lock number, and permit double acquire and release.
>>
>> But, things are not so simple. Something of my model is still wrong.
>> I counted the number of lock instances with bad sequence,
>> and ratio is like this (case of tracing whoami): bad:122, total:1956
>
>
>
> I just gave your patch a try and it's worse: almost every sequences
> were reported bad (it wasn't working either before your patch :)
>
> This is not the fault of your patch though. Actually your patch seems to
> be a nice improvement.
Thanks for your review, Frederic!
>
> In fact I just found two things:
>
> 1) We are working on tasks in pid basis. We should work on a task by
using
> its tid.
> In fact we are processing the sequences of several threads in a
process as
> if we were dealing with a single task.
>
> If A and B are two threads belonging to a same process, and if we have:
>
> A: acquire lock 1, release lock 1
> B: acquire lock 2, release lock 2
>
> ...then we are dealing with a random mess of sequences:
>
> AB: acquire lock 1, acquire lock 2, release lock 1, and any kind of
random
> things like this.
Ah, I missed tid. I'll fix this point.
>
> 2) I can't get lock_acquired traces. Not sure why yet...
Really? It's mystery... I'll seek the cause.
>
>
>>
>> There is another new bad thing.
>> The size of array of state machine is equal to max depth lockdep
defines.
>> If perf lock record tries to record lock events of the programs with
lots of
>> system call like "perf bench sched messaging", the array will be
exhausted :(
>
>
>
> Yeah, I suggest you use a list for that in fact. The max lockdep
depth may
> change in the future, or become variable, so we can't relay on that.
Yeah, I'll use list or hashtable.
>
> But that's still a cool improvement.
>
> I'm queuing this patch.
Thanks! But I have to fix some points based on your advice.
Should I send v2 patch or make fix on your tree?
Thanks,
Hitoshi
next prev parent reply other threads:[~2010-04-21 9:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 10:44 Question about " Hitoshi Mitake
2010-04-10 13:07 ` Frederic Weisbecker
2010-04-10 15:12 ` Hitoshi Mitake
2010-04-16 8:44 ` [PATCH] perf lock: Fix state machine to recognize " Hitoshi Mitake
2010-04-21 1:26 ` Frederic Weisbecker
2010-04-21 8:55 ` Peter Zijlstra
2010-04-21 12:29 ` Hitoshi Mitake
2010-04-21 16:10 ` Frederic Weisbecker
2010-04-21 9:12 ` Hitoshi Mitake [this message]
2010-04-21 16:14 ` Frederic Weisbecker
2010-04-21 12:23 ` [PATCH v2] " Hitoshi Mitake
2010-04-22 22:54 ` Frederic Weisbecker
2010-04-27 12:55 ` [tip:perf/core] " tip-bot for Hitoshi Mitake
2010-04-10 14:01 ` Question about " Peter Zijlstra
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=4BCEC166.50207@dcl.info.waseda.ac.jp \
--to=mitake@dcl.info.waseda.ac.jp \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=fweisbec@gmail.com \
--cc=h.mitake@gmail.com \
--cc=jbaron@redhat.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=xiaoguangrong@cn.fujitsu.com \
/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
Powered by JetHome