mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] alpha: Shift perf event pending work earlier in timer interrupt
@ 2010-09-19  2:05 Michael Cree
  2010-09-19  4:51 ` Matt Turner
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Cree @ 2010-09-19  2:05 UTC (permalink / raw)
  To: mattst88
  Cc: Michael Cree, linux-kernel, Richard Henderson, Ivan Kokshaysky,
	mingo, a.p.zijlstra, linux-alpha

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.

Signed-off-by: Michael Cree <mcree@orcon.net.nz>
---
 arch/alpha/kernel/time.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index eacceb2..396af17 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -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;
 }
 
-- 
1.7.1


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

* Re: [PATCH] alpha: Shift perf event pending work earlier in timer interrupt
  2010-09-19  2:05 [PATCH] alpha: Shift perf event pending work earlier in timer interrupt Michael Cree
@ 2010-09-19  4:51 ` Matt Turner
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Turner @ 2010-09-19  4:51 UTC (permalink / raw)
  To: Michael Cree
  Cc: linux-kernel, Richard Henderson, Ivan Kokshaysky, mingo,
	a.p.zijlstra, linux-alpha

On Sat, Sep 18, 2010 at 10:05 PM, Michael Cree <mcree@orcon.net.nz> wrote:
> 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.
>
> Signed-off-by: Michael Cree <mcree@orcon.net.nz>
> ---
>  arch/alpha/kernel/time.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
> index eacceb2..396af17 100644
> --- a/arch/alpha/kernel/time.c
> +++ b/arch/alpha/kernel/time.c
> @@ -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;
>  }
>
> --
> 1.7.1

Thanks! Added to my tree and sent to Linus.

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

end of thread, other threads:[~2010-09-19  4:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-19  2:05 [PATCH] alpha: Shift perf event pending work earlier in timer interrupt Michael Cree
2010-09-19  4:51 ` Matt Turner

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

all inboxes | Powered by JetHome®