]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf_event: Reduce latency of calling perf_event_do_pending
authorPaul Mackerras <paulus@samba.org>
Tue, 10 Aug 2010 20:38:23 +0000 (20:38 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 31 Aug 2010 01:35:13 +0000 (11:35 +1000)
commitce78142c0f9e96ddd6f10b8259d69b961ec8a9cb
tree82584f3fff6aede6423193784b7edb75c9b892fa
parent4bf2040c8d95d5a29717fee60f48032f6b64c029
powerpc/perf_event: Reduce latency of calling perf_event_do_pending

Commit a1c3d62b ("powerpc/perf_event: Fix oops due to
perf_event_do_pending call") moved the call to perf_event_do_pending
in timer_interrupt() down so that it was after the irq_enter() call.
Unfortunately this moved it after the code that checks whether it
is time for the next decrementer clock event.  The result is that
the call to perf_event_do_pending() won't happen until the next
decrementer clock event is due.  This was pointed out by Milton
Miller.

This fixes it by moving the check for whether it's time for the
next decrementer clock event down to the point where we're about
to call the event handler, after we've called perf_event_do_pending.

This has the side effect that on old pre-Core99 Powermacs where we
use the ppc_n_lost_interrupts mechanism to replay interrupts, a
replayed interrupt will incur a little more latency since it will
now do the code from the irq_enter down to the irq_exit, that it
used to skip.  However, these machines are now old and rare enough
that this doesn't matter.  To make it clear that ppc_n_lost_interrupts
is only used on Powermacs, and to speed up the code slightly on
non-Powermac ppc32 machines, the code that tests ppc_n_lost_interrupts
is now conditional on CONFIG_PMAC as well as CONFIG_PPC32.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: stable@kernel.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/time.c