Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1695131

[PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks update at GP start

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks update at GP start
Date 2017-07-24 23:50 +0200
Message-ID <u6ToJ-2fn-1@gated-at.bofh.it> (permalink)
References <u6ToJ-2fn-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


There is currently event tracing to track when a task is preempted
within a preemptible RCU read-side critical section, and also when that
task subsequently reaches its outermost rcu_read_unlock(), but none
indicating when a new grace period starts when that grace period must
wait on pre-existing readers that have been been preempted at least once
since the beginning of their current RCU read-side critical sections.

This commit therefore adds an event trace at grace-period start in
the case where there are such readers.  Note that only the first
reader in the list is traced.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/tree_plugin.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 14ba496a13cd..3e3f92e981a1 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -636,10 +636,17 @@ static int rcu_print_task_exp_stall(struct rcu_node *rnp)
  */
 static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp)
 {
+	struct task_struct *t;
+
 	RCU_LOCKDEP_WARN(preemptible(), "rcu_preempt_check_blocked_tasks() invoked with preemption enabled!!!\n");
 	WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp(rnp));
-	if (rcu_preempt_has_tasks(rnp))
+	if (rcu_preempt_has_tasks(rnp)) {
 		rnp->gp_tasks = rnp->blkd_tasks.next;
+		t = container_of(rnp->gp_tasks, struct task_struct,
+				 rcu_node_entry);
+		trace_rcu_unlock_preempted_task(TPS("rcu_preempt-GPS"),
+						rnp->gpnum, t->pid);
+	}
 	WARN_ON_ONCE(rnp->qsmask);
 }
 
-- 
2.5.2

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks update at GP start "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-24 23:50 +0200
  Re: [PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks  update at GP start Steven Rostedt <rostedt@goodmis.org> - 2017-07-28 03:40 +0200
    Re: [PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks  update at GP start "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-28 05:30 +0200
      Re: [PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks  update at GP start Steven Rostedt <rostedt@goodmis.org> - 2017-07-28 14:20 +0200
        Re: [PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks  update at GP start "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-28 19:20 +0200

csiph-web