From: tip-bot for Arjan van de Ven <arjan@infradead.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
torvalds@linux-foundation.org, arjan@linux.intel.com,
efault@gmx.de, peterz@infradead.org, elendil@planet.nl,
arjan@infradead.org, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:timers/urgent] x86, timers: Check for pending timers after (device) interrupts
Date: Thu, 8 Oct 2009 15:30:52 GMT [thread overview]
Message-ID: <tip-9bcbdd9c58617f1301dd4f17c738bb9bc73aca70@git.kernel.org> (raw)
In-Reply-To: <20091008064041.67219b13@infradead.org>
Commit-ID: 9bcbdd9c58617f1301dd4f17c738bb9bc73aca70
Gitweb: http://git.kernel.org/tip/9bcbdd9c58617f1301dd4f17c738bb9bc73aca70
Author: Arjan van de Ven <arjan@infradead.org>
AuthorDate: Thu, 8 Oct 2009 06:40:41 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 8 Oct 2009 17:27:27 +0200
x86, timers: Check for pending timers after (device) interrupts
Now that range timers and deferred timers are common, I found a
problem with these using the "perf timechart" tool. Frans Pop also
reported high scheduler latencies via LatencyTop, when using
iwlagn.
It turns out that on x86, these two 'opportunistic' timers only get
checked when another "real" timer happens. These opportunistic
timers have the objective to save power by hitchhiking on other
wakeups, as to avoid CPU wakeups by themselves as much as possible.
The change in this patch runs this check not only at timer
interrupts, but at all (device) interrupts. The effect is that:
1) the deferred timers/range timers get delayed less
2) the range timers cause less wakeups by themselves because
the percentage of hitchhiking on existing wakeup events goes up.
I've verified the working of the patch using "perf timechart", the
original exposed bug is gone with this patch. Frans also reported
success - the latencies are now down in the expected ~10 msec
range.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Tested-by: Frans Pop <elendil@planet.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <20091008064041.67219b13@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/irq.c | 2 ++
arch/x86/kernel/smp.c | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 74656d1..3912061 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -244,6 +244,7 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
__func__, smp_processor_id(), vector, irq);
}
+ run_local_timers();
irq_exit();
set_irq_regs(old_regs);
@@ -268,6 +269,7 @@ void smp_generic_interrupt(struct pt_regs *regs)
if (generic_interrupt_extension)
generic_interrupt_extension();
+ run_local_timers();
irq_exit();
set_irq_regs(old_regs);
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index ec1de97..d915d95 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -198,6 +198,7 @@ void smp_reschedule_interrupt(struct pt_regs *regs)
{
ack_APIC_irq();
inc_irq_stat(irq_resched_count);
+ run_local_timers();
/*
* KVM uses this interrupt to force a cpu out of guest mode
*/
next prev parent reply other threads:[~2009-10-08 15:32 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-05 13:00 [.32-rc3] scheduler: iwlagn consistently high in "waiting for CPU" Frans Pop
2009-10-05 14:13 ` Frans Pop
2009-10-05 14:24 ` Arjan van de Ven
2009-10-06 15:49 ` Frans Pop
2009-10-07 17:10 ` Frans Pop
2009-10-07 18:10 ` Mike Galbraith
2009-10-07 18:34 ` Frans Pop
2009-10-08 4:05 ` Mike Galbraith
2009-10-08 6:23 ` Mike Galbraith
2009-10-08 13:40 ` Arjan van de Ven
2009-10-08 14:13 ` Mike Galbraith
2009-10-08 14:54 ` Mike Galbraith
2009-10-08 14:55 ` Frans Pop
2009-10-08 15:09 ` Arjan van de Ven
2009-10-08 18:23 ` Mike Galbraith
2009-10-08 20:34 ` Markus Trippelsdorf
2009-10-09 3:35 ` Mike Galbraith
2009-10-09 3:51 ` Markus Trippelsdorf
2009-10-08 20:59 ` Frans Pop
2009-10-09 3:04 ` Mike Galbraith
2009-10-09 6:35 ` Mike Galbraith
2009-10-09 7:13 ` Peter Zijlstra
2009-10-09 7:55 ` Sedat Dilek
2009-10-09 7:55 ` Sedat Dilek
2009-10-09 8:06 ` Peter Zijlstra
2009-10-09 8:06 ` Peter Zijlstra
2009-10-09 14:23 ` [tip:sched/urgent] sched: Update the clock of runqueue select_task_rq() selected tip-bot for Mike Galbraith
2009-10-09 16:27 ` [.32-rc3] scheduler: iwlagn consistently high in "waiting for CPU" Frans Pop
2009-10-09 20:06 ` Mike Galbraith
2009-10-08 15:30 ` tip-bot for Arjan van de Ven [this message]
2009-10-09 14:23 ` [tip:sched/urgent] Revert "x86, timers: Check for pending timers after (device) interrupts" tip-bot for Ingo Molnar
2009-10-08 11:24 ` [.32-rc3] scheduler: iwlagn consistently high in "waiting for CPU" Mike Galbraith
2009-10-08 13:09 ` Frans Pop
2009-10-08 13:18 ` Mike Galbraith
2009-10-08 13:45 ` Arjan van de Ven
2009-10-08 14:15 ` Mike Galbraith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-9bcbdd9c58617f1301dd4f17c738bb9bc73aca70@git.kernel.org \
--to=arjan@infradead.org \
--cc=arjan@linux.intel.com \
--cc=efault@gmx.de \
--cc=elendil@planet.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.