Skip to content

Commit 43ff97c

Browse files
committed
rcu: Make synchronize_rcu_expedited() fast path update .expedited_sequence
This commit causes the early boot single-CPU synchronize_rcu_expedited() fastpath to update the rcu_state structure's ->expedited_sequence counter. This will allow the full-state polled grace-period APIs to detect all expedited grace periods without the need to track the special combined polling-only counter, which is another step towards removing the ->rgos_polled field from the rcu_gp_oldstate, thereby reducing its size by one third. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent e8755d2 commit 43ff97c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

kernel/rcu/tree_exp.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ static int rcu_print_task_exp_stall(struct rcu_node *rnp)
906906
void synchronize_rcu_expedited(void)
907907
{
908908
bool boottime = (rcu_scheduler_active == RCU_SCHEDULER_INIT);
909+
unsigned long flags;
909910
struct rcu_exp_work rew;
910911
struct rcu_node *rnp;
911912
unsigned long s;
@@ -924,6 +925,11 @@ void synchronize_rcu_expedited(void)
924925
// them, which allows reuse of ->gp_seq_polled_exp_snap.
925926
rcu_poll_gp_seq_start_unlocked(&rcu_state.gp_seq_polled_exp_snap);
926927
rcu_poll_gp_seq_end_unlocked(&rcu_state.gp_seq_polled_exp_snap);
928+
929+
local_irq_save(flags);
930+
WARN_ON_ONCE(num_online_cpus() > 1);
931+
rcu_state.expedited_sequence += (1 << RCU_SEQ_CTR_SHIFT);
932+
local_irq_restore(flags);
927933
return; // Context allows vacuous grace periods.
928934
}
929935

0 commit comments

Comments
 (0)