rcu: Prohibit starting new grace periods while forcing quiescent states

Reduce the number and variety of race conditions by prohibiting
the start of a new grace period while force_quiescent_state() is
active. A new fqs_active flag in the rcu_state structure is used
to trace whether or not force_quiescent_state() is active, and
this new flag is tested by rcu_start_gp().  If the CPU that
closed out the last grace period needs another grace period,
this new grace period may be delayed up to one scheduling-clock
tick, but it will eventually get started.

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <126264655052-git-send-email->
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
Paul E. McKenney 2010-01-04 15:09:02 -08:00 • committed by Ingo Molnar
commit 07079d5357
2 changed files with 19 additions and 14 deletions

View file

@ -277,6 +277,8 @@ struct rcu_state {
u8 signaled ____cacheline_internodealigned_in_smp;
/* Force QS state. */
u8 fqs_active; /* force_quiescent_state() */
/* is running. */
long gpnum; /* Current gp number. */
long completed; /* # of last completed gp. */