diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-06-20 16:50:40 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-08-18 20:40:09 -0400 |
commit | 1eafd31c640d6799c63136246a59d608bed93c74 (patch) | |
tree | f2ee193817ab4ce4ca4f789033d65a8a326d16bf /kernel/rcutree.c | |
parent | ae15018456c44b742d352af323e0b89eae4a6383 (diff) |
rcu: Avoid redundant grace-period kthread wakeups
When setting up an in-the-future "advanced" grace period, the code needs
to wake up the relevant grace-period kthread, which it currently does
unconditionally. However, this results in needless wakeups in the case
where the advanced grace period is being set up by the grace-period
kthread itself, which is a non-uncommon situation. This commit therefore
checks to see if the running thread is the grace-period kthread, and
avoids doing the irq_work_queue()-mediated wakeup in that case.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 91840566e294..c6a064abd6a0 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -1576,10 +1576,12 @@ rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp, | |||
1576 | 1576 | ||
1577 | /* | 1577 | /* |
1578 | * We can't do wakeups while holding the rnp->lock, as that | 1578 | * We can't do wakeups while holding the rnp->lock, as that |
1579 | * could cause possible deadlocks with the rq->lock. Deter | 1579 | * could cause possible deadlocks with the rq->lock. Defer |
1580 | * the wakeup to interrupt context. | 1580 | * the wakeup to interrupt context. And don't bother waking |
1581 | * up the running kthread. | ||
1581 | */ | 1582 | */ |
1582 | irq_work_queue(&rsp->wakeup_work); | 1583 | if (current != rsp->gp_kthread) |
1584 | irq_work_queue(&rsp->wakeup_work); | ||
1583 | } | 1585 | } |
1584 | 1586 | ||
1585 | /* | 1587 | /* |