2019-01-17 10:34:35 -08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2009-10-25 19:03:50 -07:00
|
|
|
/*
|
|
|
|
|
* Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition.
|
|
|
|
|
*
|
|
|
|
|
* Copyright IBM Corporation, 2008
|
|
|
|
|
*
|
2019-01-17 10:34:35 -08:00
|
|
|
* Author: Paul E. McKenney <paulmck@linux.ibm.com>
|
2009-10-25 19:03:50 -07:00
|
|
|
*
|
|
|
|
|
* For detailed explanation of Read-Copy Update mechanism see -
|
2009-10-26 07:55:55 +01:00
|
|
|
* Documentation/RCU
|
2009-10-25 19:03:50 -07:00
|
|
|
*/
|
|
|
|
|
#ifndef __LINUX_TINY_H
|
|
|
|
|
#define __LINUX_TINY_H
|
|
|
|
|
|
2017-05-03 15:24:25 -07:00
|
|
|
#include <linux/ktime.h>
|
2009-10-25 19:03:50 -07:00
|
|
|
|
2017-05-03 13:51:42 -07:00
|
|
|
/* Never flag non-existent other CPUs! */
|
|
|
|
|
static inline bool rcu_eqs_special_set(int cpu) { return false; }
|
2016-11-08 14:25:21 -08:00
|
|
|
|
2014-03-14 16:37:08 -07:00
|
|
|
static inline unsigned long get_state_synchronize_rcu(void)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void cond_synchronize_rcu(unsigned long oldstate)
|
|
|
|
|
{
|
|
|
|
|
might_sleep();
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-03 10:44:44 -07:00
|
|
|
extern void rcu_barrier(void);
|
2011-05-26 22:14:36 -07:00
|
|
|
|
2010-06-29 16:49:16 -07:00
|
|
|
static inline void synchronize_rcu_expedited(void)
|
|
|
|
|
{
|
2018-07-06 11:46:47 -07:00
|
|
|
synchronize_rcu();
|
2010-06-29 16:49:16 -07:00
|
|
|
}
|
|
|
|
|
|
2018-07-03 10:44:44 -07:00
|
|
|
static inline void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func)
|
2012-01-06 14:11:30 -08:00
|
|
|
{
|
|
|
|
|
call_rcu(head, func);
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-03 10:44:44 -07:00
|
|
|
void rcu_qs(void);
|
2018-07-02 14:30:37 -07:00
|
|
|
|
2018-06-28 14:45:25 -07:00
|
|
|
static inline void rcu_softirq_qs(void)
|
|
|
|
|
{
|
2018-07-03 10:44:44 -07:00
|
|
|
rcu_qs();
|
2018-06-28 14:45:25 -07:00
|
|
|
}
|
|
|
|
|
|
2017-04-11 15:50:41 -07:00
|
|
|
#define rcu_note_context_switch(preempt) \
|
|
|
|
|
do { \
|
2018-07-03 10:44:44 -07:00
|
|
|
rcu_qs(); \
|
2018-05-14 13:52:27 -07:00
|
|
|
rcu_tasks_qs(current); \
|
2017-04-11 15:50:41 -07:00
|
|
|
} while (0)
|
2010-06-29 16:49:16 -07:00
|
|
|
|
2017-05-03 15:24:25 -07:00
|
|
|
static inline int rcu_needs_cpu(u64 basemono, u64 *nextevt)
|
|
|
|
|
{
|
|
|
|
|
*nextevt = KTIME_MAX;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-04 16:31:03 +03:00
|
|
|
/*
|
|
|
|
|
* Take advantage of the fact that there is only one CPU, which
|
|
|
|
|
* allows us to ignore virtualization-based context switches.
|
|
|
|
|
*/
|
2017-05-03 13:51:42 -07:00
|
|
|
static inline void rcu_virt_note_context_switch(int cpu) { }
|
|
|
|
|
static inline void rcu_cpu_stall_reset(void) { }
|
2018-07-18 14:32:31 -07:00
|
|
|
static inline int rcu_jiffies_till_stall_check(void) { return 21 * HZ; }
|
2017-05-03 13:51:42 -07:00
|
|
|
static inline void rcu_idle_enter(void) { }
|
|
|
|
|
static inline void rcu_idle_exit(void) { }
|
|
|
|
|
static inline void rcu_irq_enter(void) { }
|
|
|
|
|
static inline void rcu_irq_exit_irqson(void) { }
|
|
|
|
|
static inline void rcu_irq_enter_irqson(void) { }
|
|
|
|
|
static inline void rcu_irq_exit(void) { }
|
|
|
|
|
static inline void exit_rcu(void) { }
|
2018-06-21 12:50:01 -07:00
|
|
|
static inline bool rcu_preempt_need_deferred_qs(struct task_struct *t)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
static inline void rcu_preempt_deferred_qs(struct task_struct *t) { }
|
2017-05-26 16:16:40 -07:00
|
|
|
#ifdef CONFIG_SRCU
|
2013-11-11 17:11:23 +02:00
|
|
|
void rcu_scheduler_starting(void);
|
2017-05-26 16:16:40 -07:00
|
|
|
#else /* #ifndef CONFIG_SRCU */
|
2017-05-03 13:51:42 -07:00
|
|
|
static inline void rcu_scheduler_starting(void) { }
|
2017-05-26 16:16:40 -07:00
|
|
|
#endif /* #else #ifndef CONFIG_SRCU */
|
2017-05-11 12:01:50 -07:00
|
|
|
static inline void rcu_end_inkernel_boot(void) { }
|
2017-05-03 13:51:42 -07:00
|
|
|
static inline bool rcu_is_watching(void) { return true; }
|
2013-09-13 17:20:11 -07:00
|
|
|
|
2017-05-03 13:51:42 -07:00
|
|
|
/* Avoid RCU read-side critical sections leaking across. */
|
|
|
|
|
static inline void rcu_all_qs(void) { barrier(); }
|
2014-12-13 20:32:04 -08:00
|
|
|
|
2016-07-13 17:17:03 +00:00
|
|
|
/* RCUtree hotplug events */
|
|
|
|
|
#define rcutree_prepare_cpu NULL
|
|
|
|
|
#define rcutree_online_cpu NULL
|
|
|
|
|
#define rcutree_offline_cpu NULL
|
|
|
|
|
#define rcutree_dead_cpu NULL
|
|
|
|
|
#define rcutree_dying_cpu NULL
|
2018-05-22 09:50:53 -07:00
|
|
|
static inline void rcu_cpu_starting(unsigned int cpu) { }
|
2016-07-13 17:17:03 +00:00
|
|
|
|
2009-10-25 19:03:50 -07:00
|
|
|
#endif /* __LINUX_RCUTINY_H */
|