aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-06-12 14:01:13 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-07-02 15:33:24 -0400
commit6ce75a2326e6f8b3bdfb60e1de7934b89858e87b (patch)
treec3ecd512422ad9f445f69c78037142a99bc8db2c /kernel/rcutree.h
parent1bca8cf1a2c3c6683b12ad28a3e826ca7a834978 (diff)
rcu: Introduce for_each_rcu_flavor() and use it
The arrival of TREE_PREEMPT_RCU some years back included some ugly code involving either #ifdef or #ifdef'ed wrapper functions to iterate over all non-SRCU flavors of RCU. This commit therefore introduces a for_each_rcu_flavor() iterator over the rcu_state structures for each flavor of RCU to clean up a bit of the ugliness. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.h')
-rw-r--r--kernel/rcutree.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index be10286ad380..b92c4550a6e6 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -422,8 +422,13 @@ struct rcu_state {
422 unsigned long gp_max; /* Maximum GP duration in */ 422 unsigned long gp_max; /* Maximum GP duration in */
423 /* jiffies. */ 423 /* jiffies. */
424 char *name; /* Name of structure. */ 424 char *name; /* Name of structure. */
425 struct list_head flavors; /* List of RCU flavors. */
425}; 426};
426 427
428extern struct list_head rcu_struct_flavors;
429#define for_each_rcu_flavor(rsp) \
430 list_for_each_entry((rsp), &rcu_struct_flavors, flavors)
431
427/* Return values for rcu_preempt_offline_tasks(). */ 432/* Return values for rcu_preempt_offline_tasks(). */
428 433
429#define RCU_OFL_TASKS_NORM_GP 0x1 /* Tasks blocking normal */ 434#define RCU_OFL_TASKS_NORM_GP 0x1 /* Tasks blocking normal */
@@ -466,25 +471,18 @@ static void rcu_stop_cpu_kthread(int cpu);
466#endif /* #ifdef CONFIG_HOTPLUG_CPU */ 471#endif /* #ifdef CONFIG_HOTPLUG_CPU */
467static void rcu_print_detail_task_stall(struct rcu_state *rsp); 472static void rcu_print_detail_task_stall(struct rcu_state *rsp);
468static int rcu_print_task_stall(struct rcu_node *rnp); 473static int rcu_print_task_stall(struct rcu_node *rnp);
469static void rcu_preempt_stall_reset(void);
470static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); 474static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp);
471#ifdef CONFIG_HOTPLUG_CPU 475#ifdef CONFIG_HOTPLUG_CPU
472static int rcu_preempt_offline_tasks(struct rcu_state *rsp, 476static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
473 struct rcu_node *rnp, 477 struct rcu_node *rnp,
474 struct rcu_data *rdp); 478 struct rcu_data *rdp);
475#endif /* #ifdef CONFIG_HOTPLUG_CPU */ 479#endif /* #ifdef CONFIG_HOTPLUG_CPU */
476static void rcu_preempt_cleanup_dead_cpu(int cpu);
477static void rcu_preempt_check_callbacks(int cpu); 480static void rcu_preempt_check_callbacks(int cpu);
478static void rcu_preempt_process_callbacks(void);
479void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); 481void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
480#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU) 482#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU)
481static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp, 483static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
482 bool wake); 484 bool wake);
483#endif /* #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU) */ 485#endif /* #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU) */
484static int rcu_preempt_pending(int cpu);
485static int rcu_preempt_cpu_has_callbacks(int cpu);
486static void __cpuinit rcu_preempt_init_percpu_data(int cpu);
487static void rcu_preempt_cleanup_dying_cpu(void);
488static void __init __rcu_init_preempt(void); 486static void __init __rcu_init_preempt(void);
489static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); 487static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags);
490static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); 488static void rcu_preempt_boost_start_gp(struct rcu_node *rnp);