summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorShai Fultheim <shai@scalemp.com>2012-04-20 00:12:32 +0200
committerIngo Molnar <mingo@kernel.org>2012-05-07 16:25:28 +0200
commit42fa4250436304d4650fa271f37671f6cee24e08 (patch)
tree72f1dfa918bef82a519af8d1c0a57a9d3b30735b /arch/x86
parentMerge branch 'stable/for-ingo-v3.5' of git://git.kernel.org/pub/scm/linux/ker... (diff)
downloadlinux-42fa4250436304d4650fa271f37671f6cee24e08.tar.xz
linux-42fa4250436304d4650fa271f37671f6cee24e08.zip
x86: Conditionally update time when ack-ing pending irqs
On virtual environments, apic_read could take a long time. As a result, under certain conditions the ack pending loop may exit without any queued irqs left, but after more than one second. A warning will be printed needlessly in this case. If the loop is about to exit regardless of max_loops, don't update it. Signed-off-by: Shai Fultheim <shai@scalemp.com> [ rebased and reworded the commit message] Signed-off-by: Ido Yariv <ido@wizery.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1334873552-31346-1-git-send-email-ido@wizery.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/apic/apic.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index edc24480469f..3beab627190e 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1325,11 +1325,13 @@ void __cpuinit setup_local_APIC(void)
acked);
break;
}
- if (cpu_has_tsc) {
- rdtscll(ntsc);
- max_loops = (cpu_khz << 10) - (ntsc - tsc);
- } else
- max_loops--;
+ if (queued) {
+ if (cpu_has_tsc) {
+ rdtscll(ntsc);
+ max_loops = (cpu_khz << 10) - (ntsc - tsc);
+ } else
+ max_loops--;
+ }
} while (queued && max_loops > 0);
WARN_ON(max_loops <= 0);