aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-06-22 01:43:26 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-09-29 00:38:19 -0400
commit385680a9487d2f85382ad6d74e2a15837e47bfd9 (patch)
tree68809ef9cdfeee43b7c08152bfdbc45d2c0d6489
parenteab0993c7ba5c7d9b3613d6037e0f31f0ccbe181 (diff)
rcu: Add event-trace markers to TREE_RCU kthreads
Add event-trace markers to TREE_RCU kthreads to allow including these kthread's CPU time in the utilization calculations. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--include/trace/events/rcu.h3
-rw-r--r--kernel/rcutree_plugin.h12
2 files changed, 15 insertions, 0 deletions
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 508824e5a77d..ac52aba00a3e 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -13,6 +13,9 @@
13 * "Start <activity>" -- Mark the start of the specified activity, 13 * "Start <activity>" -- Mark the start of the specified activity,
14 * such as "context switch". Nesting is permitted. 14 * such as "context switch". Nesting is permitted.
15 * "End <activity>" -- Mark the end of the specified activity. 15 * "End <activity>" -- Mark the end of the specified activity.
16 *
17 * An "@" character within "<activity>" is a comment character: Data
18 * reduction scripts will ignore the "@" and the remainder of the line.
16 */ 19 */
17TRACE_EVENT(rcu_utilization, 20TRACE_EVENT(rcu_utilization,
18 21
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index ecd48a2e3eeb..94d9ca1e4061 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1219,9 +1219,12 @@ static int rcu_boost_kthread(void *arg)
1219 int spincnt = 0; 1219 int spincnt = 0;
1220 int more2boost; 1220 int more2boost;
1221 1221
1222 trace_rcu_utilization("Start boost kthread@init");
1222 for (;;) { 1223 for (;;) {
1223 rnp->boost_kthread_status = RCU_KTHREAD_WAITING; 1224 rnp->boost_kthread_status = RCU_KTHREAD_WAITING;
1225 trace_rcu_utilization("End boost kthread@rcu_wait");
1224 rcu_wait(rnp->boost_tasks || rnp->exp_tasks); 1226 rcu_wait(rnp->boost_tasks || rnp->exp_tasks);
1227 trace_rcu_utilization("Start boost kthread@rcu_wait");
1225 rnp->boost_kthread_status = RCU_KTHREAD_RUNNING; 1228 rnp->boost_kthread_status = RCU_KTHREAD_RUNNING;
1226 more2boost = rcu_boost(rnp); 1229 more2boost = rcu_boost(rnp);
1227 if (more2boost) 1230 if (more2boost)
@@ -1229,11 +1232,14 @@ static int rcu_boost_kthread(void *arg)
1229 else 1232 else
1230 spincnt = 0; 1233 spincnt = 0;
1231 if (spincnt > 10) { 1234 if (spincnt > 10) {
1235 trace_rcu_utilization("End boost kthread@rcu_yield");
1232 rcu_yield(rcu_boost_kthread_timer, (unsigned long)rnp); 1236 rcu_yield(rcu_boost_kthread_timer, (unsigned long)rnp);
1237 trace_rcu_utilization("Start boost kthread@rcu_yield");
1233 spincnt = 0; 1238 spincnt = 0;
1234 } 1239 }
1235 } 1240 }
1236 /* NOTREACHED */ 1241 /* NOTREACHED */
1242 trace_rcu_utilization("End boost kthread@notreached");
1237 return 0; 1243 return 0;
1238} 1244}
1239 1245
@@ -1490,9 +1496,12 @@ static int rcu_cpu_kthread(void *arg)
1490 char work; 1496 char work;
1491 char *workp = &per_cpu(rcu_cpu_has_work, cpu); 1497 char *workp = &per_cpu(rcu_cpu_has_work, cpu);
1492 1498
1499 trace_rcu_utilization("Start CPU kthread@init");
1493 for (;;) { 1500 for (;;) {
1494 *statusp = RCU_KTHREAD_WAITING; 1501 *statusp = RCU_KTHREAD_WAITING;
1502 trace_rcu_utilization("End CPU kthread@rcu_wait");
1495 rcu_wait(*workp != 0 || kthread_should_stop()); 1503 rcu_wait(*workp != 0 || kthread_should_stop());
1504 trace_rcu_utilization("Start CPU kthread@rcu_wait");
1496 local_bh_disable(); 1505 local_bh_disable();
1497 if (rcu_cpu_kthread_should_stop(cpu)) { 1506 if (rcu_cpu_kthread_should_stop(cpu)) {
1498 local_bh_enable(); 1507 local_bh_enable();
@@ -1513,11 +1522,14 @@ static int rcu_cpu_kthread(void *arg)
1513 spincnt = 0; 1522 spincnt = 0;
1514 if (spincnt > 10) { 1523 if (spincnt > 10) {
1515 *statusp = RCU_KTHREAD_YIELDING; 1524 *statusp = RCU_KTHREAD_YIELDING;
1525 trace_rcu_utilization("End CPU kthread@rcu_yield");
1516 rcu_yield(rcu_cpu_kthread_timer, (unsigned long)cpu); 1526 rcu_yield(rcu_cpu_kthread_timer, (unsigned long)cpu);
1527 trace_rcu_utilization("Start CPU kthread@rcu_yield");
1517 spincnt = 0; 1528 spincnt = 0;
1518 } 1529 }
1519 } 1530 }
1520 *statusp = RCU_KTHREAD_STOPPED; 1531 *statusp = RCU_KTHREAD_STOPPED;
1532 trace_rcu_utilization("End CPU kthread@term");
1521 return 0; 1533 return 0;
1522} 1534}
1523 1535