Paul E. McKenney | a9b7343 | 2019-01-17 10:36:27 -0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Read-Copy Update mechanism for mutual exclusion (tree-based version) |
| 4 | * |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 5 | * Copyright IBM Corporation, 2008 |
| 6 | * |
| 7 | * Author: Dipankar Sarma <dipankar@in.ibm.com> |
Paul E. McKenney | a9b7343 | 2019-01-17 10:36:27 -0800 | [diff] [blame] | 8 | * Paul E. McKenney <paulmck@linux.ibm.com> Hierarchical algorithm |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 9 | * |
Paul E. McKenney | a9b7343 | 2019-01-17 10:36:27 -0800 | [diff] [blame] | 10 | * Based on the original work by Paul McKenney <paulmck@linux.ibm.com> |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 11 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. |
| 12 | * |
| 13 | * For detailed explanation of Read-Copy Update mechanism see - |
Paul E. McKenney | a71fca5 | 2009-09-18 10:28:19 -0700 | [diff] [blame] | 14 | * Documentation/RCU |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #ifndef __LINUX_RCUTREE_H |
| 18 | #define __LINUX_RCUTREE_H |
| 19 | |
Paul E. McKenney | d28139c | 2018-06-28 14:45:25 -0700 | [diff] [blame] | 20 | void rcu_softirq_qs(void); |
Paul E. McKenney | bcbfdd0 | 2017-04-11 15:50:41 -0700 | [diff] [blame] | 21 | void rcu_note_context_switch(bool preempt); |
Thomas Gleixner | c1ad348 | 2015-04-14 21:08:58 +0000 | [diff] [blame] | 22 | int rcu_needs_cpu(u64 basem, u64 *nextevt); |
Teodora Baluta | 584dc4c | 2013-11-11 17:11:23 +0200 | [diff] [blame] | 23 | void rcu_cpu_stall_reset(void); |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 24 | |
Gleb Natapov | 29ce831 | 2011-05-04 16:31:03 +0300 | [diff] [blame] | 25 | /* |
| 26 | * Note a virtualization-based context switch. This is simply a |
| 27 | * wrapper around rcu_note_context_switch(), which allows TINY_RCU |
Paul E. McKenney | 46a5d16 | 2015-10-07 09:10:48 -0700 | [diff] [blame] | 28 | * to save a few bytes. The caller must have disabled interrupts. |
Gleb Natapov | 29ce831 | 2011-05-04 16:31:03 +0300 | [diff] [blame] | 29 | */ |
| 30 | static inline void rcu_virt_note_context_switch(int cpu) |
| 31 | { |
Paul E. McKenney | bcbfdd0 | 2017-04-11 15:50:41 -0700 | [diff] [blame] | 32 | rcu_note_context_switch(false); |
Gleb Natapov | 29ce831 | 2011-05-04 16:31:03 +0300 | [diff] [blame] | 33 | } |
| 34 | |
Teodora Baluta | 584dc4c | 2013-11-11 17:11:23 +0200 | [diff] [blame] | 35 | void synchronize_rcu_expedited(void); |
Boqun Feng | b6a4ae7 | 2015-07-29 13:29:38 +0800 | [diff] [blame] | 36 | void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func); |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 37 | |
Teodora Baluta | 584dc4c | 2013-11-11 17:11:23 +0200 | [diff] [blame] | 38 | void rcu_barrier(void); |
Yury Norov | 1767248 | 2018-03-25 20:50:03 +0300 | [diff] [blame] | 39 | bool rcu_eqs_special_set(int cpu); |
Paul E. McKenney | 765a3f4 | 2014-03-14 16:37:08 -0700 | [diff] [blame] | 40 | unsigned long get_state_synchronize_rcu(void); |
| 41 | void cond_synchronize_rcu(unsigned long oldstate); |
Paul E. McKenney | a57eb94 | 2010-06-29 16:49:16 -0700 | [diff] [blame] | 42 | |
Paul E. McKenney | 51952bc63 | 2015-04-21 11:15:30 -0700 | [diff] [blame] | 43 | void rcu_idle_enter(void); |
| 44 | void rcu_idle_exit(void); |
| 45 | void rcu_irq_enter(void); |
| 46 | void rcu_irq_exit(void); |
Paul E. McKenney | 7c9906c | 2015-10-31 00:59:01 -0700 | [diff] [blame] | 47 | void rcu_irq_enter_irqson(void); |
| 48 | void rcu_irq_exit_irqson(void); |
Paul E. McKenney | 51952bc63 | 2015-04-21 11:15:30 -0700 | [diff] [blame] | 49 | |
Teodora Baluta | 584dc4c | 2013-11-11 17:11:23 +0200 | [diff] [blame] | 50 | void exit_rcu(void); |
Paul E. McKenney | 2439b69 | 2013-04-11 10:15:52 -0700 | [diff] [blame] | 51 | |
Teodora Baluta | 584dc4c | 2013-11-11 17:11:23 +0200 | [diff] [blame] | 52 | void rcu_scheduler_starting(void); |
Paul E. McKenney | bbad937 | 2010-04-02 16:17:17 -0700 | [diff] [blame] | 53 | extern int rcu_scheduler_active __read_mostly; |
Paul E. McKenney | d2b1654 | 2017-05-11 12:01:50 -0700 | [diff] [blame] | 54 | void rcu_end_inkernel_boot(void); |
Teodora Baluta | 584dc4c | 2013-11-11 17:11:23 +0200 | [diff] [blame] | 55 | bool rcu_is_watching(void); |
Paul E. McKenney | 395a2f0 | 2018-07-10 14:00:14 -0700 | [diff] [blame] | 56 | #ifndef CONFIG_PREEMPT |
Paul E. McKenney | 5cd3719 | 2014-12-13 20:32:04 -0800 | [diff] [blame] | 57 | void rcu_all_qs(void); |
Paul E. McKenney | 395a2f0 | 2018-07-10 14:00:14 -0700 | [diff] [blame] | 58 | #endif |
Paul E. McKenney | 5cd3719 | 2014-12-13 20:32:04 -0800 | [diff] [blame] | 59 | |
Thomas Gleixner | 4df8374 | 2016-07-13 17:17:03 +0000 | [diff] [blame] | 60 | /* RCUtree hotplug events */ |
| 61 | int rcutree_prepare_cpu(unsigned int cpu); |
| 62 | int rcutree_online_cpu(unsigned int cpu); |
| 63 | int rcutree_offline_cpu(unsigned int cpu); |
| 64 | int rcutree_dead_cpu(unsigned int cpu); |
| 65 | int rcutree_dying_cpu(unsigned int cpu); |
Peter Zijlstra | f64c601 | 2018-05-22 09:50:53 -0700 | [diff] [blame] | 66 | void rcu_cpu_starting(unsigned int cpu); |
Thomas Gleixner | 4df8374 | 2016-07-13 17:17:03 +0000 | [diff] [blame] | 67 | |
Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 68 | #endif /* __LINUX_RCUTREE_H */ |