[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130818025420.GC28923@leaf>
Date: Sat, 17 Aug 2013 19:54:20 -0700
From: Josh Triplett <josh@...htriplett.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
dipankar@...ibm.com, akpm@...ux-foundation.org,
mathieu.desnoyers@...ymtl.ca, niv@...ibm.com, tglx@...utronix.de,
peterz@...radead.org, rostedt@...dmis.org, dhowells@...hat.com,
edumazet@...gle.com, darren@...art.com, fweisbec@...il.com,
sbw@....edu, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Sedat Dilek <sedat.dilek@...il.com>,
Davidlohr Bueso <davidlohr.bueso@...com>,
Rik van Riel <riel@...riel.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH tip/core/rcu 1/5] rcu: Add duplicate-callback tests to
rcutorture
On Sat, Aug 17, 2013 at 07:25:13PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
>
> 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@...ux.vnet.ibm.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> Cc: Sedat Dilek <sedat.dilek@...il.com>
> Cc: Davidlohr Bueso <davidlohr.bueso@...com>
> Cc: Rik van Riel <riel@...riel.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Tested-by: Sedat Dilek <sedat.dilek@...il.com>
Two comments below; with those fixed,
Reviewed-by: Josh Triplett <josh@...htriplett.org>
> ---
> @@ -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.
> @@ -2163,6 +2178,28 @@ rcu_torture_init(void)
> firsterr = retval;
> goto unwind;
> }
> + if (object_debug) {
> +#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
> + struct rcu_head rh1;
> + struct rcu_head rh2;
> +
> + init_rcu_head_on_stack(&rh1);
> + init_rcu_head_on_stack(&rh2);
> + pr_alert("rcutorture: WARN: Duplicate call_rcu() test starting.\n");
> + local_irq_disable(); /* Make it hard to finish grace period. */
> + call_rcu(&rh1, rcu_torture_leak_cb); /* start grace period. */
> + call_rcu(&rh2, rcu_torture_err_cb);
> + call_rcu(&rh2, rcu_torture_err_cb); /* duplicate callback. */
> + local_irq_enable();
> + rcu_barrier();
> + pr_alert("rcutorture: WARN: Duplicate call_rcu() test complete.\n");
> + destroy_rcu_head_on_stack(&rh1);
> + destroy_rcu_head_on_stack(&rh2);
> +#else /* #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD */
> + pr_alert("rcutorture: !%s, not testing duplicate call_rcu()\n",
> + "CONFIG_DEBUG_OBJECTS_RCU_HEAD");
Why put this parameter in a separate string? That makes it harder to
grep for the full error message. (That's assuming you keep the error
message, given the comment above.)
- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists