Commit 4bace734 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Paul E. McKenney

rcu_sync: Cleanup the CONFIG_PROVE_RCU checks

1. Rename __rcu_sync_is_idle() to rcu_sync_lockdep_assert() and
   change it to use rcu_lockdep_assert().

2. Change rcu_sync_is_idle() to return rsp->gp_state == GP_IDLE
   unconditonally, this way we can remove the same check from
   rcu_sync_lockdep_assert() and clearly isolate the debugging

Note: rcu_sync_enter()->wait_event(gp_state == GP_PASSED) needs
another CONFIG_PROVE_RCU check, the same as is done in ->sync(); but
this needs some simple preparations in the core RCU code to avoid the
code duplication.
Signed-off-by: default avatarOleg Nesterov <>
Signed-off-by: default avatarPaul E. McKenney <>
Reviewed-by: default avatarJosh Triplett <>
parent cc5f730b
......@@ -40,7 +40,7 @@ struct rcu_sync {
enum rcu_sync_type gp_type;
extern bool __rcu_sync_is_idle(struct rcu_sync *);
extern void rcu_sync_lockdep_assert(struct rcu_sync *);
* rcu_sync_is_idle() - Are readers permitted to use their fastpaths?
......@@ -53,10 +53,9 @@ extern bool __rcu_sync_is_idle(struct rcu_sync *);
static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)
return __rcu_sync_is_idle(rsp);
return !rsp->gp_state; /* GP_IDLE */
return !rsp->gp_state; /* GP_IDLE */
extern void rcu_sync_init(struct rcu_sync *, enum rcu_sync_type);
......@@ -63,10 +63,10 @@ enum { CB_IDLE = 0, CB_PENDING, CB_REPLAY };
#define rss_lock gp_wait.lock
bool __rcu_sync_is_idle(struct rcu_sync *rsp)
void rcu_sync_lockdep_assert(struct rcu_sync *rsp)
return rsp->gp_state == GP_IDLE;
"suspicious rcu_sync_is_idle() usage");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment