aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShai Fultheim <shai@scalemp.com>2012-04-20 01:12:32 +0300
committerStefan Bader <stefan.bader@canonical.com>2015-05-29 11:54:14 +0200
commit61be54706f6cc94a390e0578b700913c3b680ec8 (patch)
tree9e311394ca6fb4b9346f68627350c841460c1f3a
parentfaf8e0a76ac0b8d19c3c54d56af651fa01ac536b (diff)
downloadlinux-2.6.32.y-drm33.z-61be54706f6cc94a390e0578b700913c3b680ec8.tar.gz
x86: Conditionally update time when ack-ing pending irqs
commit 42fa4250436304d4650fa271f37671f6cee24e08 upstream. 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> (cherry picked from commit c9f1417be9acae3a9867f8bdab2b7924d76cf6ac) Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
-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 1d2d6704f5d12a..be4bf4c0865101 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1250,11 +1250,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);