|
@@ -46,6 +46,7 @@
|
|
#include <linux/cpu.h>
|
|
#include <linux/cpu.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/time.h>
|
|
#include <linux/time.h>
|
|
|
|
+#include <linux/kernel_stat.h>
|
|
|
|
|
|
#include "rcutree.h"
|
|
#include "rcutree.h"
|
|
|
|
|
|
@@ -80,6 +81,9 @@ DEFINE_PER_CPU(struct rcu_data, rcu_sched_data);
|
|
struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
|
|
struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
|
|
DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
|
|
DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
|
|
|
|
|
|
|
|
+int rcu_scheduler_active __read_mostly;
|
|
|
|
+EXPORT_SYMBOL_GPL(rcu_scheduler_active);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Return true if an RCU grace period is in progress. The ACCESS_ONCE()s
|
|
* Return true if an RCU grace period is in progress. The ACCESS_ONCE()s
|
|
* permit this function to be invoked without holding the root rcu_node
|
|
* permit this function to be invoked without holding the root rcu_node
|
|
@@ -1783,6 +1787,21 @@ static int __cpuinit rcu_cpu_notify(struct notifier_block *self,
|
|
return NOTIFY_OK;
|
|
return NOTIFY_OK;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * This function is invoked towards the end of the scheduler's initialization
|
|
|
|
+ * process. Before this is called, the idle task might contain
|
|
|
|
+ * RCU read-side critical sections (during which time, this idle
|
|
|
|
+ * task is booting the system). After this function is called, the
|
|
|
|
+ * idle tasks are prohibited from containing RCU read-side critical
|
|
|
|
+ * sections. This function also enables RCU lockdep checking.
|
|
|
|
+ */
|
|
|
|
+void rcu_scheduler_starting(void)
|
|
|
|
+{
|
|
|
|
+ WARN_ON(num_online_cpus() != 1);
|
|
|
|
+ WARN_ON(nr_context_switches() > 0);
|
|
|
|
+ rcu_scheduler_active = 1;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Compute the per-level fanout, either using the exact fanout specified
|
|
* Compute the per-level fanout, either using the exact fanout specified
|
|
* or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT.
|
|
* or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT.
|