Skip to contentSkip to conversation

alpha: Shift perf event pending work earlier in timer interrupt

PATCH In review Michael Cree 2 participants 2 messages Sep 19, 2010 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alpha: Shift perf event pending work earlier in timer interrupt

Pending work from the performance event subsystem is executed in the timer interrupt. This patch shifts the call to perf_event_do_pending() before the call to update_process_times() as the latter may call back into the perf event subsystem and it is prudent to have the pending work executed first.

---
 arch/alpha/kernel/time.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/alpha/kernel/time.c +5 -5
index eacceb2..396af17 100644
@@ -191,16 +191,16 @@ irqreturn_t timer_interrupt(int irq, void *dev)
 
 	write_sequnlock(&xtime_lock);
 
-#ifndef CONFIG_SMP
-	while (nticks--)
-		update_process_times(user_mode(get_irq_regs()));
-#endif
-
 	if (test_perf_event_pending()) {
 		clear_perf_event_pending();
 		perf_event_do_pending();
 	}
 
+#ifndef CONFIG_SMP
+	while (nticks--)
+		update_process_times(user_mode(get_irq_regs()));
+#endif
+
 	return IRQ_HANDLED;
 }
 
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 38 lines · Michael Cree

Pending work from the performance event subsystem is executed in the timer interrupt.  This patch shifts the call to perf_event_do_pending() before the call to update_process_times() as the latter may call back into the perf event subsystem and it is prudent to have the pending work executed first.

---
 arch/alpha/kernel/time.c |   10 +++++-----

 1 files changed, 5 insertions(+), 5 deletions(-)
arch/alpha/kernel/time.c +5 -6
index eacceb2..396af17 100644
@@ -191,16 +191,16 @@ irqreturn_t timer_interrupt(int irq, void *dev)
 
        write_sequnlock(&xtime_lock);
 
-#ifndef CONFIG_SMP
-       while (nticks--)
-               update_process_times(user_mode(get_irq_regs()));
-#endif
-
        if (test_perf_event_pending()) {
                clear_perf_event_pending();
                perf_event_do_pending();
        }
 
+#ifndef CONFIG_SMP
+       while (nticks--)
+               update_process_times(user_mode(get_irq_regs()));
+#endif
+
        return IRQ_HANDLED;
  }
 
--
Quoted 1 line

1.7.1

Thanks! Added to my tree and sent to Linus.
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html