aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/trace/events/rcu.h14
-rw-r--r--kernel/rcu/tree.c6
2 files changed, 14 insertions, 6 deletions
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 59d40c454aa0..4674b21247f7 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -421,16 +421,18 @@ TRACE_EVENT(rcu_fqs,
421 421
422/* 422/*
423 * Tracepoint for dyntick-idle entry/exit events. These take a string 423 * Tracepoint for dyntick-idle entry/exit events. These take a string
424 * as argument: "Start" for entering dyntick-idle mode, "End" for 424 * as argument: "Start" for entering dyntick-idle mode, "Startirq" for
425 * leaving it, "--=" for events moving towards idle, and "++=" for events 425 * entering it from irq/NMI, "End" for leaving it, "Endirq" for leaving it
426 * moving away from idle. "Error on entry: not idle task" and "Error on 426 * to irq/NMI, "--=" for events moving towards idle, and "++=" for events
427 * exit: not idle task" indicate that a non-idle task is erroneously 427 * moving away from idle. "Error on entry: not idle task" and "Error
428 * on exit: not idle task" indicate that a non-idle task is erroneously
428 * toying with the idle loop. 429 * toying with the idle loop.
429 * 430 *
430 * These events also take a pair of numbers, which indicate the nesting 431 * These events also take a pair of numbers, which indicate the nesting
431 * depth before and after the event of interest. Note that task-related 432 * depth before and after the event of interest. Note that task-related
432 * events use the upper bits of each number, while interrupt-related 433 * and interrupt-related events use two separate counters, and that the
433 * events use the lower bits. 434 * "++=" and "--=" events for irq/NMI will change the counter by two,
435 * otherwise by one.
434 */ 436 */
435TRACE_EVENT(rcu_dyntick, 437TRACE_EVENT(rcu_dyntick,
436 438
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 444aa2b3f24d..d069ba2d8412 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -880,12 +880,15 @@ void rcu_nmi_exit(void)
880 * leave it in non-RCU-idle state. 880 * leave it in non-RCU-idle state.
881 */ 881 */
882 if (rdtp->dynticks_nmi_nesting != 1) { 882 if (rdtp->dynticks_nmi_nesting != 1) {
883 trace_rcu_dyntick(TPS("--="), rdtp->dynticks_nmi_nesting,
884 rdtp->dynticks_nmi_nesting - 2);
883 WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* No store tearing. */ 885 WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* No store tearing. */
884 rdtp->dynticks_nmi_nesting - 2); 886 rdtp->dynticks_nmi_nesting - 2);
885 return; 887 return;
886 } 888 }
887 889
888 /* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */ 890 /* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */
891 trace_rcu_dyntick(TPS("Startirq"), rdtp->dynticks_nmi_nesting, 0);
889 WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0); /* Avoid store tearing. */ 892 WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0); /* Avoid store tearing. */
890 rcu_dynticks_eqs_enter(); 893 rcu_dynticks_eqs_enter();
891} 894}
@@ -1057,6 +1060,9 @@ void rcu_nmi_enter(void)
1057 rcu_dynticks_eqs_exit(); 1060 rcu_dynticks_eqs_exit();
1058 incby = 1; 1061 incby = 1;
1059 } 1062 }
1063 trace_rcu_dyntick(incby == 1 ? TPS("Endirq") : TPS("++="),
1064 rdtp->dynticks_nmi_nesting,
1065 rdtp->dynticks_nmi_nesting + incby);
1060 WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* Prevent store tearing. */ 1066 WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* Prevent store tearing. */
1061 rdtp->dynticks_nmi_nesting + incby); 1067 rdtp->dynticks_nmi_nesting + incby);
1062 barrier(); 1068 barrier();