rcu: Simplify RCU_TINY RCU callback invocation
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 27 Mar 2013 17:11:15 +0000 (10:11 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 10 Jun 2013 20:45:51 +0000 (13:45 -0700)
TINY_PREEMPT_RCU could use a kthread to handle RCU callback invocation,
which required an API to abstract kthread vs. softirq invocation.
Now that TINY_PREEMPT_RCU is no longer with us, this commit retires
this API in favor of direct use of the relevant softirq primitives.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
include/linux/rcupdate.h
include/linux/rcutiny.h
include/linux/rcutree.h
kernel/rcutiny.c
kernel/rcutiny_plugin.h

index 70b1522badd3b9ca7d49366801b77f14af7acf27..257b50f9d2dc582ab6348cbec0738f3491212f4b 100644 (file)
@@ -216,6 +216,7 @@ static inline int rcu_preempt_depth(void)
 #endif /* #else #ifdef CONFIG_PREEMPT_RCU */
 
 /* Internal to kernel */
+extern void rcu_init(void);
 extern void rcu_sched_qs(int cpu);
 extern void rcu_bh_qs(int cpu);
 extern void rcu_check_callbacks(int cpu, int user);
index d3c094ffa960c7cdc37d535b3f1d5fbbcbd5f554..e756251b39bc9d33893a16e558d2650de28306b0 100644 (file)
 
 #include <linux/cache.h>
 
-static inline void rcu_init(void)
-{
-}
-
 static inline void rcu_barrier_bh(void)
 {
        wait_rcu_gp(call_rcu_bh);
index 952b793393045d63b5f0f78c9f459ba4ad81a2f4..3f1aa8f98666ab09cb5e39be30802e033b84392c 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef __LINUX_RCUTREE_H
 #define __LINUX_RCUTREE_H
 
-extern void rcu_init(void);
 extern void rcu_note_context_switch(int cpu);
 extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies);
 extern void rcu_cpu_stall_reset(void);
index 7fc2339b085928575fa224e288f029d71cc175f2..4adc9e26da34a78c8142918206b5ded4db0a11f8 100644 (file)
@@ -44,7 +44,6 @@
 
 /* Forward declarations for rcutiny_plugin.h. */
 struct rcu_ctrlblk;
-static void invoke_rcu_callbacks(void);
 static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp);
 static void rcu_process_callbacks(struct softirq_action *unused);
 static void __call_rcu(struct rcu_head *head,
@@ -227,7 +226,7 @@ void rcu_sched_qs(int cpu)
        local_irq_save(flags);
        if (rcu_qsctr_help(&rcu_sched_ctrlblk) +
            rcu_qsctr_help(&rcu_bh_ctrlblk))
-               invoke_rcu_callbacks();
+               raise_softirq(RCU_SOFTIRQ);
        local_irq_restore(flags);
 }
 
@@ -240,7 +239,7 @@ void rcu_bh_qs(int cpu)
 
        local_irq_save(flags);
        if (rcu_qsctr_help(&rcu_bh_ctrlblk))
-               invoke_rcu_callbacks();
+               raise_softirq(RCU_SOFTIRQ);
        local_irq_restore(flags);
 }
 
@@ -277,7 +276,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
                                              ACCESS_ONCE(rcp->rcucblist),
                                              need_resched(),
                                              is_idle_task(current),
-                                             rcu_is_callbacks_kthread()));
+                                             false));
                return;
        }
 
@@ -307,7 +306,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
        RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count));
        RCU_TRACE(trace_rcu_batch_end(rcp->name, cb_count, 0, need_resched(),
                                      is_idle_task(current),
-                                     rcu_is_callbacks_kthread()));
+                                     false));
 }
 
 static void rcu_process_callbacks(struct softirq_action *unused)
@@ -379,3 +378,8 @@ void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
        __call_rcu(head, func, &rcu_bh_ctrlblk);
 }
 EXPORT_SYMBOL_GPL(call_rcu_bh);
+
+void rcu_init(void)
+{
+       open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
+}
index bfe992407803505e9f1e69a492dd1947e3e50043..36fd83c544c89cc1f21af4b0797c6e2b4417e5de 100644 (file)
@@ -102,39 +102,6 @@ static void check_cpu_stalls(void)
        RCU_TRACE(check_cpu_stall_preempt());
 }
 
-/* Hold off callback invocation until early_initcall() time. */
-static int rcu_scheduler_fully_active __read_mostly;
-
-/*
- * Start up softirq processing of callbacks.
- */
-void invoke_rcu_callbacks(void)
-{
-       if (rcu_scheduler_fully_active)
-               raise_softirq(RCU_SOFTIRQ);
-}
-
-#ifdef CONFIG_RCU_TRACE
-
-/*
- * There is no callback kthread, so this thread is never it.
- */
-static bool rcu_is_callbacks_kthread(void)
-{
-       return false;
-}
-
-#endif /* #ifdef CONFIG_RCU_TRACE */
-
-static int __init rcu_scheduler_really_started(void)
-{
-       rcu_scheduler_fully_active = 1;
-       open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
-       raise_softirq(RCU_SOFTIRQ);  /* Invoke any callbacks from early boot. */
-       return 0;
-}
-early_initcall(rcu_scheduler_really_started);
-
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 #include <linux/kernel_stat.h>