aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-06-21 23:51:21 +0530
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:13 +0200
commit41e1172898c515ada8580bbaec7713253cfaa241 (patch)
treee17356e38473042b861c990d3b488fdc813b7d29 /kernel
parentfca2abec4b53f41142fa7f147b050bd27fcaa7ef (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> Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Git-commit: 1eafd31c640d6799c63136246a59d608bed93c74 [kishank@codeaurora.org resolve trivial conflicts] Signed-off-by: Kishan Kumar <kishank@codeaurora.org> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Change-Id: I1fdcf6664fdc7dce188488f05f33931e3614c853
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcutree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 20026ec30..6c0c5ede0 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1590,10 +1590,12 @@ rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp,
/*
* We can't do wakeups while holding the rnp->lock, as that
- * could cause possible deadlocks with the rq->lock. Deter
- * the wakeup to interrupt context.
+ * could cause possible deadlocks with the rq->lock. Defer
+ * the wakeup to interrupt context. And don't bother waking
+ * up the running kthread.
*/
- irq_work_queue(&rsp->wakeup_work);
+ if (current != rsp->gp_kthread)
+ irq_work_queue(&rsp->wakeup_work);
}
/*