diff options
| author | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
| commit | 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch) | |
| tree | d57f3a63479a07b4e0cece029886e76e04feb984 /include/linux/context_tracking.h | |
| parent | 5dc63e56a9cf8df0b59c234a505a1653f1bdf885 (diff) | |
| parent | 53bea86b5712c7491bb3dae12e271666df0a308c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'include/linux/context_tracking.h')
| -rw-r--r-- | include/linux/context_tracking.h | 27 | 
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index dcef4a9e4d63..d4afa8508a80 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -130,9 +130,36 @@ static __always_inline unsigned long ct_state_inc(int incby)  	return arch_atomic_add_return(incby, this_cpu_ptr(&context_tracking.state));  } +static __always_inline bool warn_rcu_enter(void) +{ +	bool ret = false; + +	/* +	 * Horrible hack to shut up recursive RCU isn't watching fail since +	 * lots of the actual reporting also relies on RCU. +	 */ +	preempt_disable_notrace(); +	if (rcu_dynticks_curr_cpu_in_eqs()) { +		ret = true; +		ct_state_inc(RCU_DYNTICKS_IDX); +	} + +	return ret; +} + +static __always_inline void warn_rcu_exit(bool rcu) +{ +	if (rcu) +		ct_state_inc(RCU_DYNTICKS_IDX); +	preempt_enable_notrace(); +} +  #else  static inline void ct_idle_enter(void) { }  static inline void ct_idle_exit(void) { } + +static __always_inline bool warn_rcu_enter(void) { return false; } +static __always_inline void warn_rcu_exit(bool rcu) { }  #endif /* !CONFIG_CONTEXT_TRACKING_IDLE */  #endif  |