Skip to contentSkip to conversation

x86: Conditionally update time when ack-ing pending irqs

PATCH Superseded Ido Yariv 2 participants 4 messages Apr 6, 2012 – May 8, 2012 x86

lore
Share & tools
lore

Ido Yariv

author
#0 lore raw

PATCH 1/1 x86: Conditionally update time when ack-ing pending irqs

From: Shai Fultheim <[email protected]>

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.

[[email protected]: rebased and reworded the commit message]
---
 arch/x86/kernel/apic/apic.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/apic.c +7 -5
index 11544d8..f0330f2 100644
@@ -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);
 
Signature · 1 line
1.7.7.6
author
#1 lore raw

PATCH RESEND 1/1 x86: Conditionally update time when ack-ing pending irqs

From: Shai Fultheim <[email protected]>

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.

[[email protected]: rebased and reworded the commit message]
---
 arch/x86/kernel/apic/apic.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/apic.c +7 -5
index 11544d8..f0330f2 100644
@@ -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);
 
Signature · 1 line
1.7.7.6
author
#2 lore raw
Quoted 7 lines · Ido Yariv

From: Shai Fultheim <[email protected]>

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.

Quoted 6 lines

If the loop is about to exit regardless of max_loops, don't update it.

[[email protected]: rebased and reworded the commit message]

---

Ping?

Thanks,
Ido.

#3 lore raw
In reply to Ido Yariv
Commit-ID:  42fa4250436304d4650fa271f37671f6cee24e08
Gitweb:     http://git.kernel.org/tip/42fa4250436304d4650fa271f37671f6cee24e08
Author:     Shai Fultheim <[email protected]>
AuthorDate: Fri, 20 Apr 2012 01:12:32 +0300
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 7 May 2012 16:25:28 +0200

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.

---
 arch/x86/kernel/apic/apic.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/apic.c +7 -5
index edc2448..3beab62 100644
@@ -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);