2019-01-17 10:36:27 -08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2008-12-18 21:55:32 +01:00
|
|
|
/*
|
|
|
|
|
* Read-Copy Update mechanism for mutual exclusion (tree-based version)
|
|
|
|
|
*
|
|
|
|
|
* Copyright IBM Corporation, 2008
|
|
|
|
|
*
|
|
|
|
|
* Author: Dipankar Sarma <dipankar@in.ibm.com>
|
2019-01-17 10:36:27 -08:00
|
|
|
* Paul E. McKenney <paulmck@linux.ibm.com> Hierarchical algorithm
|
2008-12-18 21:55:32 +01:00
|
|
|
*
|
2019-01-17 10:36:27 -08:00
|
|
|
* Based on the original work by Paul McKenney <paulmck@linux.ibm.com>
|
2008-12-18 21:55:32 +01:00
|
|
|
* 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
|
|
|
|
|
|
2018-06-28 14:45:25 -07:00
|
|
|
void rcu_softirq_qs(void);
|
2017-04-11 15:50:41 -07:00
|
|
|
void rcu_note_context_switch(bool preempt);
|
2015-04-14 21:08:58 +00:00
|
|
|
int rcu_needs_cpu(u64 basem, u64 *nextevt);
|
2013-11-11 17:11:23 +02:00
|
|
|
void rcu_cpu_stall_reset(void);
|
2008-12-18 21:55:32 +01:00
|
|
|
|
2011-05-04 16:31:03 +03:00
|
|
|
/*
|
|
|
|
|
* Note a virtualization-based context switch. This is simply a
|
|
|
|
|
* wrapper around rcu_note_context_switch(), which allows TINY_RCU
|
2015-10-07 09:10:48 -07:00
|
|
|
* to save a few bytes. The caller must have disabled interrupts.
|
2011-05-04 16:31:03 +03:00
|
|
|
*/
|
|
|
|
|
static inline void rcu_virt_note_context_switch(int cpu)
|
|
|
|
|
{
|
2017-04-11 15:50:41 -07:00
|
|
|
rcu_note_context_switch(false);
|
2011-05-04 16:31:03 +03:00
|
|
|
}
|
|
|
|
|
|
2013-11-11 17:11:23 +02:00
|
|
|
void synchronize_rcu_expedited(void);
|
2015-07-29 13:29:38 +08:00
|
|
|
void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func);
|
2012-01-06 14:11:30 -08:00
|
|
|
|
2013-11-11 17:11:23 +02:00
|
|
|
void rcu_barrier(void);
|
2018-03-25 20:50:03 +03:00
|
|
|
bool rcu_eqs_special_set(int cpu);
|
2014-03-14 16:37:08 -07:00
|
|
|
unsigned long get_state_synchronize_rcu(void);
|
|
|
|
|
void cond_synchronize_rcu(unsigned long oldstate);
|
2010-06-29 16:49:16 -07:00
|
|
|
|
2015-04-21 11:15:30 -07:00
|
|
|
void rcu_idle_enter(void);
|
|
|
|
|
void rcu_idle_exit(void);
|
|
|
|
|
void rcu_irq_enter(void);
|
|
|
|
|
void rcu_irq_exit(void);
|
2015-10-31 00:59:01 -07:00
|
|
|
void rcu_irq_enter_irqson(void);
|
|
|
|
|
void rcu_irq_exit_irqson(void);
|
2015-04-21 11:15:30 -07:00
|
|
|
|
2013-11-11 17:11:23 +02:00
|
|
|
void exit_rcu(void);
|
2013-04-11 10:15:52 -07:00
|
|
|
|
2013-11-11 17:11:23 +02:00
|
|
|
void rcu_scheduler_starting(void);
|
2010-04-02 16:17:17 -07:00
|
|
|
extern int rcu_scheduler_active __read_mostly;
|
2017-05-11 12:01:50 -07:00
|
|
|
void rcu_end_inkernel_boot(void);
|
2013-11-11 17:11:23 +02:00
|
|
|
bool rcu_is_watching(void);
|
2018-07-10 14:00:14 -07:00
|
|
|
#ifndef CONFIG_PREEMPT
|
2014-12-13 20:32:04 -08:00
|
|
|
void rcu_all_qs(void);
|
2018-07-10 14:00:14 -07:00
|
|
|
#endif
|
2014-12-13 20:32:04 -08:00
|
|
|
|
2016-07-13 17:17:03 +00:00
|
|
|
/* RCUtree hotplug events */
|
|
|
|
|
int rcutree_prepare_cpu(unsigned int cpu);
|
|
|
|
|
int rcutree_online_cpu(unsigned int cpu);
|
|
|
|
|
int rcutree_offline_cpu(unsigned int cpu);
|
|
|
|
|
int rcutree_dead_cpu(unsigned int cpu);
|
|
|
|
|
int rcutree_dying_cpu(unsigned int cpu);
|
2018-05-22 09:50:53 -07:00
|
|
|
void rcu_cpu_starting(unsigned int cpu);
|
2016-07-13 17:17:03 +00:00
|
|
|
|
2008-12-18 21:55:32 +01:00
|
|
|
#endif /* __LINUX_RCUTREE_H */
|