Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323521
b: refs/heads/master
c: 5d4b865
h: refs/heads/master
i:
  323519: c226b24
v: v3
  • Loading branch information
Paul E. McKenney committed Sep 23, 2012
1 parent 0a34801 commit a731cd4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e5c2dfb4de15e21f62c956ec32cda9372ca993b
refs/heads/master: 5d4b86594984d8746b01487c768d8548463c173f
40 changes: 17 additions & 23 deletions trunk/kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,37 +1141,31 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
* they can do to advance the grace period. It is therefore
* safe for us to drop the lock in order to mark the grace
* period as completed in all of the rcu_node structures.
*
* But if this CPU needs another grace period, it will take
* care of this while initializing the next grace period.
* We use RCU_WAIT_TAIL instead of the usual RCU_DONE_TAIL
* because the callbacks have not yet been advanced: Those
* callbacks are waiting on the grace period that just now
* completed.
*/
rdp = this_cpu_ptr(rsp->rda);
if (*rdp->nxttail[RCU_WAIT_TAIL] == NULL) {
raw_spin_unlock_irq(&rnp->lock);
raw_spin_unlock_irq(&rnp->lock);

/*
* Propagate new ->completed value to rcu_node
* structures so that other CPUs don't have to
* wait until the start of the next grace period
* to process their callbacks.
*/
rcu_for_each_node_breadth_first(rsp, rnp) {
raw_spin_lock_irq(&rnp->lock);
rnp->completed = rsp->gpnum;
raw_spin_unlock_irq(&rnp->lock);
cond_resched();
}
rnp = rcu_get_root(rsp);
/*
* Propagate new ->completed value to rcu_node structures so
* that other CPUs don't have to wait until the start of the next
* grace period to process their callbacks. This also avoids
* some nasty RCU grace-period initialization races by forcing
* the end of the current grace period to be completely recorded in
* all of the rcu_node structures before the beginning of the next
* grace period is recorded in any of the rcu_node structures.
*/
rcu_for_each_node_breadth_first(rsp, rnp) {
raw_spin_lock_irq(&rnp->lock);
rnp->completed = rsp->gpnum;
raw_spin_unlock_irq(&rnp->lock);
cond_resched();
}
rnp = rcu_get_root(rsp);
raw_spin_lock_irq(&rnp->lock);

rsp->completed = rsp->gpnum; /* Declare grace period done. */
trace_rcu_grace_period(rsp->name, rsp->completed, "end");
rsp->fqs_state = RCU_GP_IDLE;
rdp = this_cpu_ptr(rsp->rda);
if (cpu_needs_another_gp(rsp, rdp))
rsp->gp_flags = 1;
raw_spin_unlock_irq(&rnp->lock);
Expand Down

0 comments on commit a731cd4

Please sign in to comment.