rcu: provide rcu_virt_note_context_switch() function.
authorGleb Natapov <gleb@redhat.com>
Wed, 4 May 2011 13:31:03 +0000 (16:31 +0300)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 6 May 2011 06:16:59 +0000 (23:16 -0700)
Provide rcu_virt_note_context_switch() for vitalization use to note
quiescent state during guest entry.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/rcutiny.h
include/linux/rcutree.h
kernel/rcutree.c

index 30ebd7c8d874b4dfeb9c9c9e5c5e857fbb43ab62..52b3e0281fd0ab2e5699783ca6f206a653bd280a 100644 (file)
@@ -99,6 +99,14 @@ static inline void rcu_note_context_switch(int cpu)
        rcu_preempt_note_context_switch();
 }
 
+/*
+ * Take advantage of the fact that there is only one CPU, which
+ * allows us to ignore virtualization-based context switches.
+ */
+static inline void rcu_virt_note_context_switch(int cpu)
+{
+}
+
 /*
  * Return the number of grace periods.
  */
index 284dad10c55bcc358d11dbea565e4853726ef5fc..e65d06634dd80c7afc94ea7032110bcd925ac258 100644 (file)
@@ -35,6 +35,16 @@ extern void rcu_note_context_switch(int cpu);
 extern int rcu_needs_cpu(int cpu);
 extern void rcu_cpu_stall_reset(void);
 
+/*
+ * Note a virtualization-based context switch.  This is simply a
+ * wrapper around rcu_note_context_switch(), which allows TINY_RCU
+ * to save a few bytes.
+ */
+static inline void rcu_virt_note_context_switch(int cpu)
+{
+       rcu_note_context_switch(cpu);
+}
+
 #ifdef CONFIG_TREE_PREEMPT_RCU
 
 extern void exit_rcu(void);
index b2fe2a273df2eb442f1d3a56a766cf92cc94fcf8..54ff7eb92819063458b7bddc554a762a195e6d57 100644 (file)
@@ -157,6 +157,7 @@ void rcu_note_context_switch(int cpu)
        rcu_sched_qs(cpu);
        rcu_preempt_note_context_switch(cpu);
 }
+EXPORT_SYMBOL_GPL(rcu_note_context_switch);
 
 #ifdef CONFIG_NO_HZ
 DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {