Skip to content

rcu: clean up locking for ->completed and ->gpnum fields

Paul E. McKenney lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rcu: cleanups for non-NO_HZ handling of ->completed counter.kernel/rcutree.c kernel/rcutree.h+34 -410 replies
2/3rcu: cleanups for rcu_process_gp_end() uses of ->completed counterkernel/rcutree.c kernel/rcutree.h+83 -480 replies
3/3rcu: cleanups for note_new_gpnum() uses of ->gpnumkernel/rcutree.c+27 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH tip/core/rcu 0/3] rcu: clean up locking for ->completed and ->gpnum fields

Hello!

This patch series imposes a clear locking model on accesses to the ->completed and ->gpnum fields, significantly increasing the reliability of RCU. To be fair, in order to induce failures in current -tip, you have to run long rcutorture tests on particular hardware with particular kernel configuration parameters, while having modified the RCU implementation itself to invoke force_quiescent_state() several times as often as normal. By "particular hardware", I do mean specific machines that appear otherwise identical to other machines with much lower (and sometimes even nonexistent) failure rates. After all, these are race conditions, and as such can be affected by very subtle factors.

That said, RCU really needs to stand up to whatever abuse shows up, hence these patches.

1. The first patch puts non-NO_HZ accesses to the ->completed field

	under a well-defined locking design, eliminating the
	unsynchronized accesses to rsp->completed from the
	dyntick_recall_completed() function.

2. The second patch puts the rcu_process_gp_end() function's use

	of the ->completed field under a well-defined locking design,
	eliminating its previously unsynchronized accesses to
	rsp->completed.

3. The third and final patch puts accesses to the ->gpnum field

	under a well-defined locking design, eliminating the
	unsynchronized accesses to rsp->gpnum from the note_new_gpnum()
	function.

A number of unsynchronized accesses remain, but these are of the form of an unsynchronized check followed by a lock acquisition followed by a repeat of the check.

Thanx, Paul