aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-02-22 16:42:43 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-05-06 02:16:55 -0400
commit0ea1f2ebeb217d38770aebf91c4ecaa8e01b3305 (patch)
treeef558d2eb804ca033a5166d24f5b4be7cf87727f /kernel/rcutree_plugin.h
parent67b98dba474f293c389fc2b7254dcf7c0492e3bd (diff)
rcu: Add boosting to TREE_PREEMPT_RCU tracing
Includes total number of tasks boosted, number boosted on behalf of each of normal and expedited grace periods, and statistics on attempts to initiate boosting that failed for various reasons. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r--kernel/rcutree_plugin.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 4e486255df63..07d346445d12 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1073,6 +1073,33 @@ static void __init __rcu_init_preempt(void)
1073 1073
1074#include "rtmutex_common.h" 1074#include "rtmutex_common.h"
1075 1075
1076#ifdef CONFIG_RCU_TRACE
1077
1078static void rcu_initiate_boost_trace(struct rcu_node *rnp)
1079{
1080 if (list_empty(&rnp->blkd_tasks))
1081 rnp->n_balk_blkd_tasks++;
1082 else if (rnp->exp_tasks == NULL && rnp->gp_tasks == NULL)
1083 rnp->n_balk_exp_gp_tasks++;
1084 else if (rnp->gp_tasks != NULL && rnp->boost_tasks != NULL)
1085 rnp->n_balk_boost_tasks++;
1086 else if (rnp->gp_tasks != NULL && rnp->qsmask != 0)
1087 rnp->n_balk_notblocked++;
1088 else if (rnp->gp_tasks != NULL &&
1089 ULONG_CMP_GE(jiffies, rnp->boost_time))
1090 rnp->n_balk_notyet++;
1091 else
1092 rnp->n_balk_nos++;
1093}
1094
1095#else /* #ifdef CONFIG_RCU_TRACE */
1096
1097static void rcu_initiate_boost_trace(struct rcu_node *rnp)
1098{
1099}
1100
1101#endif /* #else #ifdef CONFIG_RCU_TRACE */
1102
1076/* 1103/*
1077 * Carry out RCU priority boosting on the task indicated by ->exp_tasks 1104 * Carry out RCU priority boosting on the task indicated by ->exp_tasks
1078 * or ->boost_tasks, advancing the pointer to the next task in the 1105 * or ->boost_tasks, advancing the pointer to the next task in the
@@ -1108,10 +1135,14 @@ static int rcu_boost(struct rcu_node *rnp)
1108 * expedited grace period must boost all blocked tasks, including 1135 * expedited grace period must boost all blocked tasks, including
1109 * those blocking the pre-existing normal grace period. 1136 * those blocking the pre-existing normal grace period.
1110 */ 1137 */
1111 if (rnp->exp_tasks != NULL) 1138 if (rnp->exp_tasks != NULL) {
1112 tb = rnp->exp_tasks; 1139 tb = rnp->exp_tasks;
1113 else 1140 rnp->n_exp_boosts++;
1141 } else {
1114 tb = rnp->boost_tasks; 1142 tb = rnp->boost_tasks;
1143 rnp->n_normal_boosts++;
1144 }
1145 rnp->n_tasks_boosted++;
1115 1146
1116 /* 1147 /*
1117 * We boost task t by manufacturing an rt_mutex that appears to 1148 * We boost task t by manufacturing an rt_mutex that appears to
@@ -1197,8 +1228,10 @@ static void rcu_initiate_boost(struct rcu_node *rnp)
1197{ 1228{
1198 struct task_struct *t; 1229 struct task_struct *t;
1199 1230
1200 if (!rcu_preempt_blocked_readers_cgp(rnp) && rnp->exp_tasks == NULL) 1231 if (!rcu_preempt_blocked_readers_cgp(rnp) && rnp->exp_tasks == NULL) {
1232 rnp->n_balk_exp_gp_tasks++;
1201 return; 1233 return;
1234 }
1202 if (rnp->exp_tasks != NULL || 1235 if (rnp->exp_tasks != NULL ||
1203 (rnp->gp_tasks != NULL && 1236 (rnp->gp_tasks != NULL &&
1204 rnp->boost_tasks == NULL && 1237 rnp->boost_tasks == NULL &&
@@ -1209,7 +1242,8 @@ static void rcu_initiate_boost(struct rcu_node *rnp)
1209 t = rnp->boost_kthread_task; 1242 t = rnp->boost_kthread_task;
1210 if (t != NULL) 1243 if (t != NULL)
1211 wake_up_process(t); 1244 wake_up_process(t);
1212 } 1245 } else
1246 rcu_initiate_boost_trace(rnp);
1213} 1247}
1214 1248
1215/* 1249/*