From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: akpm@linux-foundation.org, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com,
laijs@cn.fujitsu.com, dipankar@in.ibm.com, josh@joshtriplett.org,
dvhltc@us.ibm.com, niv@us.ibm.com, peterz@infradead.org,
rostedt@goodmis.org, Valdis.Kletnieks@vt.edu,
dhowells@redhat.com, eric.dumazet@gmail.com, adobriyan@gmail.com,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [patch 1/5] Debugobjects transition check
Date: Wed, 31 Mar 2010 10:27:36 -0400 [thread overview]
Message-ID: <20100331142736.GA26207@Krystal> (raw)
In-Reply-To: <alpine.LFD.2.00.1003311549250.32352@localhost.localdomain>
* Thomas Gleixner (tglx@linutronix.de) wrote:
> On Wed, 31 Mar 2010, Mathieu Desnoyers wrote:
>
> > * Thomas Gleixner (tglx@linutronix.de) wrote:
> > > On Mon, 29 Mar 2010, Mathieu Desnoyers wrote:
> > >
> > > > Implement a basic state machine checker in the debugobjects.
> > >
> > > Can you please add some real explanation how that checker works and
> > > why we want to have it ?
> >
> > We can add this to the changelog. Is it worth it to create a Documentation file
> > for it ?
>
> I meant the changelog. The "Implement ...." line was not really helpful :)
>
> >
> > This state machine checker detects races and inconsistencies within the "active"
> > life of a debugobject. The checker only keeps track of the current state; all
> > the state machine logic is kept at the object instance level.
> >
> > The checker works by adding a supplementary "unsigned int astate" field to the
> > debug_obj structure. It keeps track of the current "active state" of the object.
> >
> > The only constraints that are imposed on the states by the debugobjects system
> > is that:
> >
> > - activation of an object sets the current active state to 0,
> > - deactivation of an object expects the current active state to be 0.
> >
> > For the rest of the states, the state mapping is determined by the specific
> > object instance. Therefore, the logic keeping track of the state machine is
> > within the specialized instance, without any need to know about it at the
> > debugobject level.
> >
> > The current object active state is changed by calling:
> >
> > debug_object_active_state(addr, descr, expect, next)
> >
> > where "expect" is the expected state and "next" is the next state to move to if
> > the expected state is found. A warning is generated if the expected is not
> > found.
>
> Does it only warn or is there a callback to fixup things as well ?
For the moment, it only warns. I have not seen the need for a fixup callback
yet. It might become useful at some point, but I prefer to proceed
incrementally. This kind of callback could become quite big too, because it
would have to deal with transitions "from each to each" states of the system,
with, in the worse case scenario, different fixups for each situation.
Just for the specific case of "do RCU batch", when detecting that a non-queued
rcu head is there for execution, there are a few cases to consider:
- List corruption
- Appears in two lists.
- Appears in the same list twice.
- Race (two threads reading the list at the same time).
- ...
I am probably forgetting about others. So one way to fixup this would be not to
execute the callback, but even then, the lists might be corrupted. So it's not
at all clear to me if we can do much better than reporting the inconsistency
without increasing intrusiveness. But maybe I just need more imagination. ;)
Thanks,
Mathieu
>
> Thanks,
>
> tglx
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2010-03-31 14:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 14:34 [patch 0/5] RCU head debug (v5) Mathieu Desnoyers
2010-03-29 14:34 ` [patch 1/5] Debugobjects transition check Mathieu Desnoyers
2010-03-30 16:21 ` Thomas Gleixner
2010-03-31 13:31 ` Mathieu Desnoyers
2010-03-31 13:51 ` Thomas Gleixner
2010-03-31 14:27 ` Mathieu Desnoyers [this message]
2010-04-06 8:15 ` Thomas Gleixner
2010-04-06 12:53 ` [patch 1/5] Debugobjects transition check (updated changelog) Mathieu Desnoyers
2010-04-15 18:32 ` Thomas Gleixner
2010-04-15 18:37 ` Paul E. McKenney
2010-03-29 14:34 ` [patch 2/5] rcu head introduce rcu head init on stack Mathieu Desnoyers
2010-03-29 14:34 ` [patch 3/5] remove all rcu head initializations, except on_stack initializations Mathieu Desnoyers
2010-03-29 14:34 ` [patch 4/5] rcu head remove init Mathieu Desnoyers
2010-03-29 14:34 ` [patch 5/5] tree/tiny rcu: Add debug RCU head objects (v5) Mathieu Desnoyers
2010-03-29 15:14 ` [PATCH] rcu head debug consider on stack fixup Mathieu Desnoyers
-- strict thread matches above, loose matches on Subject: below --
2010-04-17 12:48 [patch 0/5] rcu head debugobjects Mathieu Desnoyers
2010-04-17 12:48 ` [patch 1/5] Debugobjects transition check Mathieu Desnoyers
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=20100331142736.GA26207@Krystal \
--to=mathieu.desnoyers@efficios.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=eric.dumazet@gmail.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=niv@us.ibm.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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