Skip to contentSkip to conversation

sched/perf: make sure irqs are disabled for perf_event_task_sched_in()

PATCH In review Jamie Iles 1 participant 2 messages Jan 8, 2010 – Jan 13, 2010

lore
Share & tools
lore

Jamie Iles

author
#0 lore raw

PATCH 1/1 sched/perf: make sure irqs are disabled for perf_event_task_sched_in()

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().

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Russell King - ARM Linux <[email protected]>
---
 kernel/sched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
kernel/sched.c +6 -0
index 22c14eb..78132b4 100644
@@ -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);
Signature · 1 line
1.6.5.4
#1 lore raw

[tip:perf/core] sched/perf: Make sure irqs are disabled for perf_event_task_sched_in()

Commit-ID:  8381f65d097dad90416808314737dd7d3ae38ea9
Gitweb:     http://git.kernel.org/tip/8381f65d097dad90416808314737dd7d3ae38ea9
Author:     Jamie Iles <[email protected]>
AuthorDate: Fri, 8 Jan 2010 15:27:33 +0000
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 13 Jan 2010 10:43:08 +0100

sched/perf: Make sure irqs are disabled for perf_event_task_sched_in()

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().

LKML-Reference: <[email protected]>

---
 kernel/sched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
kernel/sched.c +6 -0
index e507af0..c3ad342 100644
@@ -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);