Commit c9f1417b authored by Shai Fultheim's avatar Shai Fultheim Committed by Ben Hutchings

x86: Conditionally update time when ack-ing pending irqs

commit 42fa4250 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: default avatarShai Fultheim <shai@scalemp.com>
[ rebased and reworded the commit message]
Signed-off-by: default avatarIdo Yariv <ido@wizery.com>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1334873552-31346-1-git-send-email-ido@wizery.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 468afa5d
......@@ -1309,11 +1309,13 @@ void __cpuinit setup_local_APIC(void)
acked);
break;
}
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment