No description
Find a file
Paolo Bonzini b5fc314bcb target-i386: yield to another VCPU on PAUSE
After commit b1bbfe7 (aio / timers: On timer modification, qemu_notify
or aio_notify, 2013-08-21) FreeBSD guests report a huge slowdown.

The problem shows up as soon as FreeBSD turns out its periodic (~1 ms)
tick, but the timers are only the trigger for a pre-existing problem.

Before the offending patch, setting a timer did a timer_settime system call.

After, setting the timer exits the event loop (which uses poll) and
reenters it with a new deadline.  This does not cause any slowdown; the
difference is between one system call (timer_settime and a signal
delivery (SIGALRM) before the patch, and two system calls afterwards
(write to a pipe or eventfd + calling poll again when re-entering the
event loop).

Unfortunately, the exit/enter causes the main loop to grab the iothread
lock, which in turns kicks the VCPU thread out of execution.  This
causes TCG to execute the next VCPU in its round-robin scheduling of
VCPUS.  When the second VCPU is mostly unused, FreeBSD runs a "pause"
instruction in its idle loop which only burns cycles without any
progress.  As soon as the timer tick expires, the first VCPU runs
the interrupt handler but very soon it sets it again---and QEMU
then goes back doing nothing in the second VCPU.

The fix is to make the pause instruction do "cpu_loop_exit".

Reported-by: Luigi Rizzo <rizzo@iet.unipi.it>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21 17:39:20 +01:00
audio
backends rng-egd: offset the point when repeatedly read from the buffer 2013-11-21 17:39:17 +01:00
block
bsd-user
default-configs
disas
docs
dtc@bc895d6d09
fpu
fsdev
gdb-xml
hw vfio-pci: Fix multifunction=on 2013-11-21 17:39:04 +01:00
include atomic.h: Fix build with clang 2013-11-21 17:38:57 +01:00
libcacard
linux-headers
linux-user
net
pc-bios sun4m: Add FCode ROM for TCX framebuffer 2013-11-21 17:38:52 +01:00
pixman@97336fad32
po
qapi
qga
qobject
qom
roms
scripts
slirp
stubs
sysconfigs/target
target-alpha
target-arm
target-cris
target-i386 target-i386: yield to another VCPU on PAUSE 2013-11-21 17:39:20 +01:00
target-lm32
target-m68k
target-microblaze
target-mips
target-moxie
target-openrisc
target-ppc
target-s390x
target-sh4
target-sparc
target-unicore32
target-xtensa
tcg
tests
trace
ui
util
.exrc
.gitignore
.gitmodules
.mailmap
.travis.yml
aio-posix.c
aio-win32.c
arch_init.c
async.c
balloon.c
block-migration.c
block.c
blockdev-nbd.c
blockdev.c
blockjob.c
bt-host.c
bt-vhci.c
Changelog
CODING_STYLE
configure configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0 2013-11-21 17:38:52 +01:00
COPYING
COPYING.LIB
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
cpu-exec.c
cpus.c
cputlb.c
device-hotplug.c
device_tree.c
disas.c
dma-helpers.c
dump.c
exec.c
gdbstub.c
HACKING
hmp-commands.hx
hmp.c
hmp.h
iohandler.c
ioport.c
kvm-all.c
kvm-stub.c
LICENSE
main-loop.c
MAINTAINERS
Makefile sun4m: Add FCode ROM for TCX framebuffer 2013-11-21 17:38:52 +01:00
Makefile.objs
Makefile.target
memory.c
memory_mapping.c
migration-exec.c
migration-fd.c
migration-rdma.c
migration-tcp.c
migration-unix.c
migration.c
monitor.c
nbd.c
os-posix.c
os-win32.c
page_cache.c
qapi-schema.json
qdev-monitor.c
qdict-test-data.txt
qemu-bridge-helper.c
qemu-char.c
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-doc.texi
qemu-img-cmds.hx
qemu-img.c
qemu-img.texi
qemu-io-cmds.c
qemu-io.c
qemu-log.c
qemu-nbd.c
qemu-nbd.texi
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx
qemu-seccomp.c
qemu-tech.texi
qemu-timer.c
qemu.nsi
qemu.sasl
qmp-commands.hx
qmp.c
qtest.c
readline.c
README
rules.mak
savevm.c
spice-qemu-char.c
tcg-runtime.c
tci.c
thread-pool.c
thunk.c
tpm.c
trace-events
translate-all.c
translate-all.h
user-exec.c
VERSION
version.rc
vl.c Merge remote-tracking branch 'mjt/trivial-patches' into staging 2013-11-19 12:59:26 -08:00
xbzrle.c
xen-all.c
xen-mapcache.c
xen-stub.c

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team