[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1334873552-31346-1-git-send-email-ido@wizery.com>
Date: Fri, 20 Apr 2012 01:12:32 +0300
From: Ido Yariv <ido@...ery.com>
To: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>
Cc: Shai Fultheim <shai@...lemp.com>, Ido Yariv <ido@...ery.com>
Subject: [PATCH RESEND] x86: Conditionally update time when ack-ing pending irqs
From: Shai Fultheim <shai@...lemp.com>
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@...lemp.com>
[ido@...ery.com: rebased and reworded the commit message]
Signed-off-by: Ido Yariv <ido@...ery.com>
---
arch/x86/kernel/apic/apic.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 11544d8..f0330f2 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);
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists