mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/perf: make sure irqs are disabled for perf_event_task_sched_in()
@ 2010-01-08 15:27 Jamie Iles
  2010-01-13 10:37 ` [tip:perf/core] sched/perf: Make " tip-bot for Jamie Iles
  0 siblings, 1 reply; 2+ messages in thread
From: Jamie Iles @ 2010-01-08 15:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jamie Iles, Ingo Molnar, Peter Zijlstra, Russell King - ARM Linux

perf_event_task_sched_in() expects interrupts to be disabled, but
on architectures with __ARCH_WANT_INTERRUPTS_ON_CTXSW defined, this
isn't true. If this is defined, disable irqs around the call in
finish_task_switch().

Signed-off-by: Jamie Iles <jamie.iles@picochip.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
---
 kernel/sched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 22c14eb..78132b4 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2783,7 +2783,13 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
 	 */
 	prev_state = prev->state;
 	finish_arch_switch(prev);
+#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
+	local_irq_disable();
+#endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */
 	perf_event_task_sched_in(current);
+#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
+	local_irq_enable();
+#endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */
 	finish_lock_switch(rq, prev);
 
 	fire_sched_in_preempt_notifiers(current);
-- 
1.6.5.4


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

end of thread, other threads:[~2010-01-13 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-08 15:27 [PATCH] sched/perf: make sure irqs are disabled for perf_event_task_sched_in() Jamie Iles
2010-01-13 10:37 ` [tip:perf/core] sched/perf: Make " tip-bot for Jamie Iles

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