Fw: RCU boot debug patch

From: Paul E. McKenney
Date: Tue Jul 19 2011 - 18:41:47 EST

Hello, Julie and Ravi,

Although we arrived at a patch that worked for both of you, we never did
identify exactly which RCU callback (or other issue) that was causing
the problem. It would be good to do this in case there is some other
problem lurking that might bite us in the future. Mingming has therefore
put together the following diagnostic patch which should identify the
callbacks, please see below.

So could you please run this and let us know what you find? There should
at least be a message for artificial_callback().

Thanx, Paul


A debug patch to verify if there is RCU callbacks before the rcu scheduler is active. Please looking
at the dmesg to see if any message print out related to this other than the artificial one.

Signed_off_by: Mingming Cao <cmm@xxxxxxxxxx>
diff --git a/init/main.c b/init/main.c
index d7211fa..2abc1a5 100644
--- a/init/main.c
+++ b/init/main.c
@@ -452,11 +452,13 @@ static void __init mm_init(void)
+static void artificial_callback(struct rcu_head *p) {};

asmlinkage void __init start_kernel(void)
char * command_line;
extern const struct kernel_param __start___param[], __stop___param[];
+ static struct rcu_head artificial_rcu_head;


@@ -531,6 +533,7 @@ asmlinkage void __init start_kernel(void)
+ call_rcu(&artificial_rcu_head, artificial_callback);
/* init some links before init_ISA_irqs() */
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index ba06207..60ca927 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1514,6 +1514,11 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
head->func = func;
head->next = NULL;

+ if ((system_state == SYSTEM_BOOTING) && (!rcu_scheduler_active))
+ printk(KERN_ALERT "RCU scheduler is not active yet, "
+ "Calling _call_rcu() with this function %pf\n",
+ func);
smp_mb(); /* Ensure RCU update seen before callback registry. */


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/