mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf,core: do no try to schedule task events if there are none.
@ 2011-11-22 14:08 Gleb Natapov
  2011-11-22 14:12 ` Peter Zijlstra
  2011-12-07 15:44 ` [tip:perf/urgent] perf: Do " tip-bot for Gleb Natapov
  0 siblings, 2 replies; 3+ messages in thread
From: Gleb Natapov @ 2011-11-22 14:08 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Ingo Molnar, linux-kernel

perf_event_sched_in() shouldn't try to schedule task events if there
are none otherwise task's ctx->is_active will be set and will not be
cleared during sched_out. This will prevent newly added events from
being scheduled into the task context.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---

The patch is against tip/perf/urgent since it depends on commit
1d5f003f5a9 there.  I've sent updated version of above commit earlier but
unfortunately old version was applied and I do not see amended version
in Peter's queue either. So here is incremental fix.

diff --git a/kernel/events/core.c b/kernel/events/core.c
index b0c1186..920314e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2171,11 +2171,11 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx,
 	 */
 	cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
 
-	perf_event_sched_in(cpuctx, ctx, task);
-
 	if (ctx->nr_events)
 		cpuctx->task_ctx = ctx;
 
+	perf_event_sched_in(cpuctx, cpuctx->task_ctx, task);
+
 	perf_pmu_enable(ctx->pmu);
 	perf_ctx_unlock(cpuctx, ctx);
 
--
			Gleb.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-07 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 14:08 [PATCH] perf,core: do no try to schedule task events if there are none Gleb Natapov
2011-11-22 14:12 ` Peter Zijlstra
2011-12-07 15:44 ` [tip:perf/urgent] perf: Do " tip-bot for Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome