linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Yariv <ido@wizery.com>
To: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: Shai Fultheim <shai@scalemp.com>, Ido Yariv <ido@wizery.com>
Subject: [PATCH RESEND] x86: Conditionally update time when ack-ing pending irqs
Date: Fri, 20 Apr 2012 01:12:32 +0300	[thread overview]
Message-ID: <1334873552-31346-1-git-send-email-ido@wizery.com> (raw)
In-Reply-To: <1333716101-26186-1-git-send-email-ido@wizery.com>

From: Shai Fultheim <shai@scalemp.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@scalemp.com>
[ido@wizery.com: rebased and reworded the commit message]
Signed-off-by: Ido Yariv <ido@wizery.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


  reply	other threads:[~2012-04-19 22:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 12:41 [PATCH] x86: Conditionally update time when ack-ing pending irqs Ido Yariv
2012-04-19 22:12 ` Ido Yariv [this message]
2012-05-05 23:50   ` [PATCH RESEND] " Ido Yariv
2012-05-08  4:24   ` [tip:x86/apic] " tip-bot for Shai Fultheim

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=1334873552-31346-1-git-send-email-ido@wizery.com \
    --to=ido@wizery.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=shai@scalemp.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).