History

rcu: IPI all CPUs at GP end for strict GPs

Currently, each CPU discovers the end of a given grace period on its own time, which is again good for efficiency but bad for fast grace periods, given that it is things like kfree() within the RCU callbacks that will cause trouble for pointers leaked from RCU read-side critical sections. This commit therefore uses on_each_cpu() to IPI each CPU after grace-period cleanup in order to inform each CPU of the end of the old grace period in a timely manner, but only in kernels build with CONFIG_RCU_STRICT_GRACE_PERIOD=y. Reported-by Jann Horn <jannh@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Paul E. McKenney committed 6 years ago

Commit 4e025f51 parent 933ada21 file · +4 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/rcu/tree.c+4−0
@@ -2052,6 +2052,10 @@ static void rcu_gp_cleanup(void) · 2051 unmodified lines
20522052 rcu_state.gp_flags & RCU_GP_FLAG_INIT);
20532053 }
20542054 raw_spin_unlock_irq_rcu_node(rnp);
2055+
2056+ // If strict, make all CPUs aware of the end of the old grace period.
2057+ if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD))
2058+ on_each_cpu(rcu_strict_gp_boundary, NULL, 0);
20552059 }
20562060
20572061 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t