Skip to content

RFC: split the global mutex

Marcelo Tosatti kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13QEMU: get rid of global cpu_single_envqemu/block-raw-posix.c qemu/cpu-all.h qemu/cpu-exec.c +12 more+128 -770 replies
2/13QEMU: introduce QEMUDeviceqemu/cpu-all.h qemu/hw/hw.h qemu/qemu-common.h +2 more+98 -00 replies
3/13QEMU: make esp.c build conditional to SPARC targetqemu/Makefile.target+2 -10 replies
4/13QEMU: plug QEMUDevice pt1 / ioport awarenessqemu/audio/audio.h qemu/hw/acpi.c qemu/hw/cirrus_vga.c +32 more+369 -2560 replies
5/13QEMU: add a mutex to protect IRQ chip data structuresqemu/hw/apic.c qemu/hw/i8259.c qemu/hw/pc.c +1 more+41 -30 replies
6/13QEMU: plug QEMUDevice pt2 / iomem awarenessqemu/cpu-all.h qemu/exec.c qemu/hw/apic.c +19 more+93 -390 replies
7/13QEMU: grab device lock for ioport/iomem processingqemu/cpu-all.h qemu/exec.c qemu/hw/pc.c +2 more+123 -60 replies
8/13QEMU: character device lockingqemu/hw/serial.c qemu/qemu-char.h qemu/qemu-device.h +1 more+72 -170 replies
9/13QEMU: network device lockingqemu/hw/e1000.c qemu/hw/virtio-net.c qemu/net.h +2 more+57 -180 replies
10/13QEMU: get rid of aiocb cacheqemu/block.c qemu/block_int.h+5 -120 replies
11/13QEMU: block device lockingqemu/block-qcow.c qemu/block-qcow2.c qemu/block-raw-posix.c +5 more+79 -40 replies
12/13QEMU: scsi-disk reentrancy fixqemu/hw/scsi-disk.c+6 -60 replies
13/13QEMU/KVM: get rid of global lockqemu/qemu-kvm.c+4 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 00/13] RFC: split the global mutex

Introduce QEMUDevice, making the ioport/iomem->device relationship visible.

At the moment it only contains a lock, but could be extended.

With it the following is possible:
- vcpu's to read/write via ioports/iomem while the iothread is working on some unrelated device, or just copying data from the kernel.
- vcpu's to read/write via ioports/iomem to different devices simultaneously.

This patchset is only a proof of concept kind of thing, so only serial+raw image are supported.

Tried two benchmarks, iperf and tiobench. With tiobench the reported latency is significantly lower (20%+), but throughput with IDE is only slightly higher.

Expect to see larger improvements with a higher performing IO scheme (SCSI still buggy, looking at it).

The iperf numbers are pretty good. Performance of UP guests increase slightly but SMP is quite significant.

Note that workloads with multiple busy devices (such as databases, web servers) should be the real winners.

What is the feeling on this? Its not _that_ intrusive and can be easily NOP'ed out for QEMU.

iperf -c 4 -i 60

---- e1000

UP guest:
global lock

[SUM]  0.0-10.0 sec    156 MBytes    131 Mbits/sec
[SUM]  0.0-10.0 sec    151 MBytes    126 Mbits/sec
[SUM]  0.0-10.0 sec    151 MBytes    126 Mbits/sec
[SUM]  0.0-10.0 sec    151 MBytes    127 Mbits/sec
per-device lock
[SUM]  0.0-10.0 sec    164 MBytes    137 Mbits/sec
[SUM]  0.0-10.0 sec    161 MBytes    135 Mbits/sec
[SUM]  0.0-10.0 sec    158 MBytes    133 Mbits/sec
[SUM]  0.0-10.0 sec    171 MBytes    143 Mbits/sec

SMP guest (4-way)
global lock

[SUM]  0.0-13.0 sec    402 MBytes    259 Mbits/sec
[SUM]  0.0-10.1 sec    469 MBytes    391 Mbits/sec
[SUM]  0.0-10.1 sec    477 MBytes    397 Mbits/sec
[SUM]  0.0-10.0 sec    469 MBytes    393 Mbits/sec
per-device lock
[SUM]  0.0-13.0 sec    471 MBytes    304 Mbits/sec
[SUM]  0.0-10.2 sec    532 MBytes    439 Mbits/sec
[SUM]  0.0-10.1 sec    510 MBytes    423 Mbits/sec
[SUM]  0.0-10.1 sec    529 MBytes    441 Mbits/sec

----- virtio-net
UP guest:
global lock

[SUM]  0.0-13.0 sec    192 MBytes    124 Mbits/sec
[SUM]  0.0-10.0 sec    213 MBytes    178 Mbits/sec
[SUM]  0.0-10.0 sec    213 MBytes    178 Mbits/sec
[SUM]  0.0-10.0 sec    213 MBytes    178 Mbits/sec
per-device lock
[SUM]  0.0-13.0 sec    193 MBytes    125 Mbits/sec
[SUM]  0.0-10.0 sec    210 MBytes    176 Mbits/sec
[SUM]  0.0-10.0 sec    218 MBytes    183 Mbits/sec
[SUM]  0.0-10.0 sec    216 MBytes    181 Mbits/sec

SMP guest:
global lock

[SUM]  0.0-13.0 sec    446 MBytes    288 Mbits/sec
[SUM]  0.0-10.0 sec    521 MBytes    437 Mbits/sec
[SUM]  0.0-10.0 sec    525 MBytes    440 Mbits/sec
[SUM]  0.0-10.0 sec    533 MBytes    446 Mbits/sec
per-device lock
[SUM]  0.0-13.0 sec    512 MBytes    331 Mbits/sec
[SUM]  0.0-10.0 sec    617 MBytes    517 Mbits/sec
[SUM]  0.0-10.1 sec    631 MBytes    527 Mbits/sec
[SUM]  0.0-10.0 sec    626 MBytes    524 Mbits/sec
Signature · 5 lines
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone