]> xenbits.xensource.com Git - xen.git/commit
x86: suppress event check IPI to MWAITing CPUs
authorJan Beulich <jbeulich@suse.com>
Thu, 18 Sep 2014 12:43:49 +0000 (14:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Sep 2014 12:43:49 +0000 (14:43 +0200)
commit9a727a813e9b25003e433b3dc3fa47e621f9e238
tree5600676b74f05608e363bf910f4408dbe755c422
parent6a10e2385a7409a4f88248d09a80a03b2bdaca76
x86: suppress event check IPI to MWAITing CPUs

Mass wakeups (via vlapic_ipi()) can take enormous amounts of time,
especially when many of the remote pCPU-s are in deep C-states. For
64-vCPU Windows Server 2012 R2 guests on Ivybridge hardware,
accumulated times of over 2ms were observed (average 1.1ms).
Considering that Windows broadcasts IPIs from its timer interrupt,
which at least at certain times can run at 1kHz, it is clear that this
can't result in good guest behavior. In fact, on said hardware guests
with significantly beyond 40 vCPU-s simply hung when e.g. ServerManager
gets started.

Recognizing that writes to softirq_pending() already have the effect of
waking remote CPUs from MWAITing (due to being co-located on the same
cache line with mwait_wakeup()), we can avoid sending IPIs to CPUs we
know are in a (deep) C-state entered via MWAIT.

With this, average broadcast times for a 64-vCPU guest went down to a
measured maximum of 255us (which is still quite a lot).

One aspect worth noting is that cpumask_raise_softirq() gets brought in
sync here with cpu_raise_softirq() in that now both don't attempt to
raise a self-IPI on the processing CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/acpi/cpu_idle.c
xen/common/softirq.c
xen/include/asm-arm/softirq.h
xen/include/asm-x86/softirq.h