Re: [PATCH tip/core/rcu 1/5] rcu: Add duplicate-callback tests torcutorture

From: Josh Triplett
Date: Mon Aug 19 2013 - 00:20:36 EST


On Sun, Aug 18, 2013 at 08:55:28PM -0700, Paul E. McKenney wrote:
> On Sat, Aug 17, 2013 at 07:54:20PM -0700, Josh Triplett wrote:
> > On Sat, Aug 17, 2013 at 07:25:13PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
> > >
> > > This commit adds a object_debug option to rcutorture to allow the
> > > debug-object-based checks for duplicate call_rcu() invocations to
> > > be deterministically tested.
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
> > > Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> > > Cc: Sedat Dilek <sedat.dilek@xxxxxxxxx>
> > > Cc: Davidlohr Bueso <davidlohr.bueso@xxxxxx>
> > > Cc: Rik van Riel <riel@xxxxxxxxxxx>
> > > Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > > Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> > > Tested-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
> >
> > Two comments below; with those fixed,
> > Reviewed-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
> >
> > > ---
> > > @@ -100,6 +101,8 @@ module_param(fqs_stutter, int, 0444);
> > > MODULE_PARM_DESC(fqs_stutter, "Wait time between fqs bursts (s)");
> > > module_param(n_barrier_cbs, int, 0444);
> > > MODULE_PARM_DESC(n_barrier_cbs, "# of callbacks/kthreads for barrier testing");
> > > +module_param(object_debug, int, 0444);
> > > +MODULE_PARM_DESC(object_debug, "Enable debug-object double call_rcu() testing");
> >
> > modules-next has a change to ignore and warn about
> > unknown module parameters. Thus, I'd suggest wrapping the ifdef around
> > this module parameter, so it doesn't exist at all without
> > CONFIG_DEBUG_OBJECTS_RCU_HEAD.
> >
> > Alternatively, consider providing the test unconditionally, and just
> > printing a big warning message saying that it's going to cause
> > corruption in the !CONFIG_DEBUG_OBJECTS_RCU_HEAD case.
>
> I currently do something like the above. The module parameter
> is defined unconditionally, but the actual tests are under #ifdef
> CONFIG_DEBUG_OBJECTS_RCU_HEAD. If you specify object_debug for a
> !CONFIG_DEBUG_OBJECTS_RCU_HEAD kernel, the pr_alert() below happens,
> and the test is omitted, thus avoiding the list corruption.
>
> Seem reasonable?

That's exactly the bit I was commenting on. I'm saying that you should
either make the test unconditional (perhaps with a warning saying it's
about to cause list corruption), or you should compile out the module
parameter as well and then you don't need the pr_alert (since current
kernels will emit a warning when you pass a non-existent module
parameter).

Personally, I'd go with the latter.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/