2008-12-18 21:55:32 +01:00
|
|
|
/*
|
|
|
|
|
* Read-Copy Update mechanism for mutual exclusion (tree-based version)
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* Copyright IBM Corporation, 2008
|
|
|
|
|
*
|
|
|
|
|
* Author: Dipankar Sarma <dipankar@in.ibm.com>
|
|
|
|
|
* Paul E. McKenney <paulmck@linux.vnet.ibm.com> Hierarchical algorithm
|
|
|
|
|
*
|
|
|
|
|
* Based on the original work by Paul McKenney <paulmck@us.ibm.com>
|
|
|
|
|
* and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
|
|
|
|
|
*
|
|
|
|
|
* For detailed explanation of Read-Copy Update mechanism see -
|
2009-09-18 10:28:19 -07:00
|
|
|
* Documentation/RCU
|
2008-12-18 21:55:32 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __LINUX_RCUTREE_H
|
|
|
|
|
#define __LINUX_RCUTREE_H
|
|
|
|
|
|
2010-09-09 13:40:39 -07:00
|
|
|
extern void rcu_init(void);
|
2010-04-01 17:37:01 -07:00
|
|
|
extern void rcu_note_context_switch(int cpu);
|
2008-12-18 21:55:32 +01:00
|
|
|
extern int rcu_needs_cpu(int cpu);
|
2010-08-10 14:28:53 -07:00
|
|
|
extern void rcu_cpu_stall_reset(void);
|
2008-12-18 21:55:32 +01:00
|
|
|
|
2009-08-22 13:56:52 -07:00
|
|
|
#ifdef CONFIG_TREE_PREEMPT_RCU
|
|
|
|
|
|
|
|
|
|
extern void exit_rcu(void);
|
|
|
|
|
|
|
|
|
|
#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
|
|
|
|
|
|
|
|
|
|
static inline void exit_rcu(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
|
|
|
|
|
|
2010-03-30 15:46:01 -07:00
|
|
|
extern void synchronize_rcu_bh(void);
|
2009-10-14 10:15:56 -07:00
|
|
|
extern void synchronize_rcu_expedited(void);
|
2009-06-25 09:08:16 -07:00
|
|
|
|
|
|
|
|
static inline void synchronize_rcu_bh_expedited(void)
|
|
|
|
|
{
|
|
|
|
|
synchronize_sched_expedited();
|
2008-12-18 21:55:32 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-29 16:49:16 -07:00
|
|
|
extern void rcu_barrier(void);
|
|
|
|
|
|
2008-12-18 21:55:32 +01:00
|
|
|
extern long rcu_batches_completed(void);
|
|
|
|
|
extern long rcu_batches_completed_bh(void);
|
2009-08-22 13:56:46 -07:00
|
|
|
extern long rcu_batches_completed_sched(void);
|
2010-01-04 15:09:10 -08:00
|
|
|
extern void rcu_force_quiescent_state(void);
|
|
|
|
|
extern void rcu_bh_force_quiescent_state(void);
|
|
|
|
|
extern void rcu_sched_force_quiescent_state(void);
|
2008-12-18 21:55:32 +01:00
|
|
|
|
2009-09-23 09:50:42 -07:00
|
|
|
/* A context switch is a grace period for RCU-sched and RCU-bh. */
|
2009-02-25 18:03:42 -08:00
|
|
|
static inline int rcu_blocking_is_gp(void)
|
|
|
|
|
{
|
|
|
|
|
return num_online_cpus() == 1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-02 16:17:17 -07:00
|
|
|
extern void rcu_scheduler_starting(void);
|
|
|
|
|
extern int rcu_scheduler_active __read_mostly;
|
|
|
|
|
|
2008-12-18 21:55:32 +01:00
|
|
|
#endif /* __LINUX_RCUTREE_H */
|