/* * Take the context lock here so that if find_get_context is@@ -6780,6 +6788,7 @@ static void perf_event_exit_task_context * incremented the context's refcount before we do put_ctx below. */ raw_spin_lock(&child_ctx->lock);+ task_ctx_sched_out(child_ctx, EVENT_ALL); child->perf_event_ctxp[ctxn] = NULL; /* * If this context is a clone; unclone it so it can't get