public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	a.p.zijlstra@chello.nl, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/core] perf: Remove task_ctx_sched_in()
Date: Sat, 28 May 2011 16:39:56 GMT	[thread overview]
Message-ID: <tip-04dc2dbbfe1c6f81b996d4dab255da75f9efbb4a@git.kernel.org> (raw)
In-Reply-To: <20110409192141.817893268@chello.nl>

Commit-ID:  04dc2dbbfe1c6f81b996d4dab255da75f9efbb4a
Gitweb:     http://git.kernel.org/tip/04dc2dbbfe1c6f81b996d4dab255da75f9efbb4a
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Sat, 9 Apr 2011 21:17:43 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 28 May 2011 18:01:14 +0200

perf: Remove task_ctx_sched_in()

Make task_ctx_sched_*() imply EVENT_ALL, since anything less will not
actually have scheduled the task in/out at all.

Since there's no site that schedules all of a task in (due to the
interleave with flexible cpuctx) we can remove this function.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110409192141.817893268@chello.nl
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/events/core.c |   26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index d243af9..66b3dd8 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1979,8 +1979,7 @@ void __perf_event_task_sched_out(struct task_struct *task,
 		perf_cgroup_sched_out(task);
 }
 
-static void task_ctx_sched_out(struct perf_event_context *ctx,
-			       enum event_type_t event_type)
+static void task_ctx_sched_out(struct perf_event_context *ctx)
 {
 	struct perf_cpu_context *cpuctx = __get_cpu_context(ctx);
 
@@ -1990,7 +1989,7 @@ static void task_ctx_sched_out(struct perf_event_context *ctx,
 	if (WARN_ON_ONCE(ctx != cpuctx->task_ctx))
 		return;
 
-	ctx_sched_out(ctx, cpuctx, event_type);
+	ctx_sched_out(ctx, cpuctx, EVENT_ALL);
 	cpuctx->task_ctx = NULL;
 }
 
@@ -2098,19 +2097,6 @@ static void cpu_ctx_sched_in(struct perf_cpu_context *cpuctx,
 	ctx_sched_in(ctx, cpuctx, event_type, task);
 }
 
-static void task_ctx_sched_in(struct perf_event_context *ctx,
-			      enum event_type_t event_type)
-{
-	struct perf_cpu_context *cpuctx;
-
-	cpuctx = __get_cpu_context(ctx);
-	if (cpuctx->task_ctx == ctx)
-		return;
-
-	ctx_sched_in(ctx, cpuctx, event_type, NULL);
-	cpuctx->task_ctx = ctx;
-}
-
 static void perf_event_context_sched_in(struct perf_event_context *ctx,
 					struct task_struct *task)
 {
@@ -2363,7 +2349,7 @@ static void perf_rotate_context(struct perf_cpu_context *cpuctx)
 
 	cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
 	if (ctx)
-		task_ctx_sched_out(ctx, EVENT_FLEXIBLE);
+		ctx_sched_out(ctx, cpuctx, EVENT_FLEXIBLE);
 
 	rotate_ctx(&cpuctx->ctx);
 	if (ctx)
@@ -2371,7 +2357,7 @@ static void perf_rotate_context(struct perf_cpu_context *cpuctx)
 
 	cpu_ctx_sched_in(cpuctx, EVENT_FLEXIBLE, current);
 	if (ctx)
-		task_ctx_sched_in(ctx, EVENT_FLEXIBLE);
+		ctx_sched_in(ctx, cpuctx, EVENT_FLEXIBLE, current);
 
 done:
 	if (remove)
@@ -2435,7 +2421,7 @@ static void perf_event_enable_on_exec(struct perf_event_context *ctx)
 	perf_cgroup_sched_out(current);
 
 	raw_spin_lock(&ctx->lock);
-	task_ctx_sched_out(ctx, EVENT_ALL);
+	task_ctx_sched_out(ctx);
 
 	list_for_each_entry(event, &ctx->pinned_groups, group_entry) {
 		ret = event_enable_on_exec(event, ctx);
@@ -6794,7 +6780,7 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn)
 	 * 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);
+	task_ctx_sched_out(child_ctx);
 	child->perf_event_ctxp[ctxn] = NULL;
 	/*
 	 * If this context is a clone; unclone it so it can't get

  reply	other threads:[~2011-05-28 16:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 19:17 [RFC][PATCH 0/9] perf: Rework event scheduling Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 1/9] perf: Optimize ctx_sched_out Peter Zijlstra
2011-05-28 16:38   ` [tip:perf/core] perf: Optimize ctx_sched_out() tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 2/9] perf: Clean up ctx reference counting Peter Zijlstra
2011-04-11  6:05   ` Lin Ming
2011-04-11  8:35     ` Peter Zijlstra
2011-05-28 16:39   ` [tip:perf/core] perf: Clean up 'ctx' " tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 3/9] perf: Change event scheduling locking Peter Zijlstra
2011-05-28 16:39   ` [tip:perf/core] perf: Optimize " tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 4/9] perf: Remove task_ctx_sched_in Peter Zijlstra
2011-05-28 16:39   ` tip-bot for Peter Zijlstra [this message]
2011-04-09 19:17 ` [RFC][PATCH 5/9] perf: Simplify and fix __perf_install_in_context Peter Zijlstra
2011-04-10  8:13   ` Peter Zijlstra
2011-04-11  8:44     ` Lin Ming
2011-04-11  8:50       ` Peter Zijlstra
2011-04-11  8:12   ` Lin Ming
2011-05-28 16:40   ` [tip:perf/core] perf: Simplify and fix __perf_install_in_context() tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 6/9] perf: Change ctx::is_active semantics Peter Zijlstra
2011-05-28 16:40   ` [tip:perf/core] perf: Change and simplify " tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 7/9] perf: Collect the schedule in rules in one function Peter Zijlstra
2011-05-28 16:41   ` [tip:perf/core] perf: Collect the schedule-in " tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 8/9] perf: Change close() semantics for group events Peter Zijlstra
2011-05-28 16:41   ` [tip:perf/core] " tip-bot for Peter Zijlstra
2011-04-09 19:17 ` [RFC][PATCH 9/9] perf: De-schedule a task context when removing the last event Peter Zijlstra
2011-05-28 16:42   ` [tip:perf/core] " tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-04dc2dbbfe1c6f81b996d4dab255da75f9efbb4a@git.kernel.org \
    --to=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox