Re: Badness at kernel/rcutree.c:1228



Hey,

I put the debug function under init/main.c after rcu_init(); but there
is no output on dmesg which means that it receives zero value.

Full dmesg: http://xnet.fi/opt/apps/lkml-2.6.32-vanilla.dmesg.rcu-init.txt

--Mikko Kortelainen

2009/12/8 Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>:
On Tue, Dec 08, 2009 at 11:22:07AM -0800, Paul E. McKenney wrote:
At this point, I must defer to those more skilled than I at diagnosing
early-boot problems.

Well, that is silly on my part -- the problem seems to appear late in
boot, and you had no problem capturing that portion of the boot log.

So please see below for a patch providing a rcu_check_beenonline()
function that, when called after rcu_init(), returns non-zero if the
beenonline fields have become corrupted.  So put calls of the form:

       WARN_ON_ONCE(rcu_check_beenonline());

in the initialization code path preceding the problem.  Either #include
rcupdate.h or explicitly declare the function as appropriate.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---

diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 9642c6b..190a687 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -39,6 +39,8 @@ extern int rcu_cpu_notify(struct notifier_block *self,
 extern int rcu_needs_cpu(int cpu);
 extern int rcu_expedited_torture_stats(char *page);

+extern int rcu_check_beenonline(void);
+
 #ifdef CONFIG_TREE_PREEMPT_RCU

 extern void __rcu_read_lock(void);
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 207125b..27d3722 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -77,6 +77,17 @@ DEFINE_PER_CPU(struct rcu_data, rcu_sched_data);
 struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
 DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);

+/*
+ * Ad-hoc diagnostic function, for use only after rcu_init() has
+ * returned.  Assumes that the boot CPU is CPU 0.  Assumes that
+ * the kernel has been built with CONFIG_TREE_RCU.  Not for inclusion.
+ * Usage: "WARN_ON_ONCE(rcu_check_beenonline());"
+ */
+int rcu_check_beenonline(void)
+{
+       return !per_cpu(rcu_sched_data, 0).beenonline ||
+              !per_cpu(rcu_bh_data, 0).beenonline;
+}

 /*
 * Return true if an RCU grace period is in progress.  The ACCESS_ONCE()s

--
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/



Relevant Pages

  • Re: Badness at kernel/rcutree.c:1228
    ... I put the debug function under init/main.c after rcu_init; ... is no output on dmesg which means that it receives zero value. ... Could you please send the patch you applied to, as you said, put the ... and you had no problem capturing that portion of the boot log. ...
    (Linux-Kernel)
  • Re: futex_cmpxchg_enabled not set in futex_init on pentium3
    ... Producing in dmesg: ... Thus it is completely clear that the virtual zero page is mapped, ... other than the lack of those futex functions which rely on a null pointer ...
    (Linux-Kernel)
  • Re: [PATCH] x86/pci: make pci_mem_start to be aligned only -v4
    ... On Sun, Apr 19, 2009 at 12:35 PM, Yannick Roehlly ... I attach the boot log (dmesg output). ...
    (Linux-Kernel)
  • Re: logging shutdown messages
    ... Try dmesg, it will show the boot log ... LeVA wrote: ... What's My GnuPG Keys? ...
    (Debian-User)
  • Re: dmesg empty after shutdown -r
    ... Everything seems to be running normally, except "dmesg" produces ... and /var/run/dmesg.boot is zero bytes long. ... Problem with today's modular software: ...
    (freebsd-questions)