diff options
| author | Paul E. McKenney <paulmck@kernel.org> | 2024-10-28 13:07:11 -0700 |
|---|---|---|
| committer | Uladzislau Rezki (Sony) <urezki@gmail.com> | 2024-12-14 17:03:41 +0100 |
| commit | 0f38c06cab7712fc82c314fe4264a8897f3e6365 (patch) | |
| tree | 34436c8e49b4b288e9955f19f5ef4f46b4d41273 /include/linux/rcupdate_wait.h | |
| parent | 4569cf60b6caf26995f314a0c1e14f73ab8c924b (diff) | |
rcutorture: Check preemption for failing reader
This commit checks to see if the RCU reader has been preempted within
its read-side critical section for RCU flavors supporting this notion
(currently only preemptible RCU). If such a preemption occurred, then
this is printed at the end of the "Failure/close-call rcutorture reader
segments" list at the end of the rcutorture run.
[ paulmck: Apply kernel test robot feedback. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Tested-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Diffstat (limited to 'include/linux/rcupdate_wait.h')
| -rw-r--r-- | include/linux/rcupdate_wait.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h index 303ab9bee155..f9bed3d3f78d 100644 --- a/include/linux/rcupdate_wait.h +++ b/include/linux/rcupdate_wait.h @@ -65,4 +65,15 @@ static inline void cond_resched_rcu(void) #endif } +// Has the current task blocked within its current RCU read-side +// critical section? +static inline bool has_rcu_reader_blocked(void) +{ +#ifdef CONFIG_PREEMPT_RCU + return !list_empty(¤t->rcu_node_entry); +#else + return false; +#endif +} + #endif /* _LINUX_SCHED_RCUPDATE_WAIT_H */ |
