From 1638c9b4fa42c188ffa962552146537f8fb3d26e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 27 Aug 2012 09:57:09 -0400 Subject: [PATCH] Document limitation of vppid and ppid context wrt eventual RCU instrumentation Signed-off-by: Mathieu Desnoyers --- lttng-context-ppid.c | 9 +++++++++ lttng-context-vppid.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/lttng-context-ppid.c b/lttng-context-ppid.c index 05819048..58ff3fe7 100644 --- a/lttng-context-ppid.c +++ b/lttng-context-ppid.c @@ -46,6 +46,15 @@ void ppid_record(struct lttng_ctx_field *field, { pid_t ppid; + + /* + * TODO: when we eventually add RCU subsystem instrumentation, + * taking the rcu read lock here will trigger RCU tracing + * recursively. We should modify the kernel synchronization so + * it synchronizes both for RCU and RCU sched, and rely on + * rcu_read_lock_sched_notrace. + */ + rcu_read_lock(); ppid = task_tgid_nr(current->real_parent); rcu_read_unlock(); diff --git a/lttng-context-vppid.c b/lttng-context-vppid.c index 365d9739..06377a30 100644 --- a/lttng-context-vppid.c +++ b/lttng-context-vppid.c @@ -51,6 +51,15 @@ void vppid_record(struct lttng_ctx_field *field, * current nsproxy can be NULL when scheduled out of exit. pid_vnr uses * the current thread nsproxy to perform the lookup. */ + + /* + * TODO: when we eventually add RCU subsystem instrumentation, + * taking the rcu read lock here will trigger RCU tracing + * recursively. We should modify the kernel synchronization so + * it synchronizes both for RCU and RCU sched, and rely on + * rcu_read_lock_sched_notrace. + */ + rcu_read_lock(); parent = rcu_dereference(current->real_parent); if (!current->nsproxy) -- 2.34.1