All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] support virtio mmio specification Version 3
@ 2019-12-25  2:50 Zha Bin
  2019-12-25  2:50 ` [PATCH v1 1/2] x86/msi: Enhance x86 to support platform_msi Zha Bin
                   ` (2 more replies)
  0 siblings, 3 replies; 60+ messages in thread
From: Zha Bin @ 2019-12-25  2:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: mst, jasowang, slp, virtio-dev, gerry, zhabin, jing2.liu, chao.p.peng

In cloud native environment, we need a lightweight and secure system. It
should benefit from the speed of containers and the security of VM, which
is classified as secure containers. The traditional solution of cloud VM
is Qemu. In fact we don't need to pay for the legacy devices. Currently,
more userspace VMMs, e.g. Qemu, Firecracker, Cloud Hypervisor and Alibaba
Cloud VMM which is called Dragonball, began to pay attention to a
lightweight solution.

The lightweight VMM is suitable to cloud native infrastructure which is
designed for creating secure sandbox to address the requirements of
multi-tenant. Meanwhile, with faster startup time and lower memory
overhead, it makes possible to launch thousands of microVMs on the same
machine. This VMM minimizes the emulation devices and uses virtio-mmio to
get a more lightweight transport layer. The virtio-mmio devices have less
code than virtio-pci, which can decrease boot time and increase deploy
density by customizing kernel such as setting pci=off. From another point
of view, the minimal device can reduce the attack surface.

We have compared the number of files and the lines of code between
virtio-mmio and virio-pci.

				Virtio-PCI	    Virtio-MMIO	
	number of files(Linux)	    161			1
	lines of code(Linux)	    78237		538
	number of files(Qemu)	    24			1
	lines of code(Qemu)	    8952		421

But the current standard virtio-mmio spec has some limitations which is
only support legacy interrupt and will cause performance penalties.

To address such limitation, we proposed to update virtio-mmio spec to
version 3 to add the MSI interrupt and doorbell notify features[1], which
can achieve the same performance as virtio-pci devices with only around 400
lines of code.

Here are the performance gain of MSI interrupt in virtio-mmio. Each case is
repeated three times.

        netperf -t TCP_RR -H 192.168.1.36 -l 30 -- -r 32,1024

                Virtio-PCI    Virtio-MMIO   Virtio-MMIO(MSI)
        trans/s     9536        6939            9500
        trans/s     9734        7029            9749
        trans/s     9894        7095            9318

With the virtio spec proposal[1], other VMMs (e.g. Qemu) can also make use
of the new features to get a enhancing performance.

[1] https://lkml.org/lkml/2019/12/20/113

Liu Jiang (2):
  x86/msi: Enhance x86 to support platform_msi
  virtio-mmio: add features for virtio-mmio specification version 3

 arch/x86/Kconfig                 |   6 ++
 arch/x86/include/asm/hw_irq.h    |   5 +
 arch/x86/include/asm/irqdomain.h |   9 ++
 arch/x86/kernel/apic/msi.c       |  74 +++++++++++++
 drivers/base/platform-msi.c      |   4 +-
 drivers/virtio/virtio_mmio.c     | 226 ++++++++++++++++++++++++++++++++++++---
 include/linux/msi.h              |   1 +
 include/uapi/linux/virtio_mmio.h |  28 +++++
 8 files changed, 337 insertions(+), 16 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2020-01-21  5:03 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25  2:50 [PATCH v1 0/2] support virtio mmio specification Version 3 Zha Bin
2019-12-25  2:50 ` [PATCH v1 1/2] x86/msi: Enhance x86 to support platform_msi Zha Bin
2019-12-26  8:21   ` Jason Wang
2019-12-26  8:21     ` [virtio-dev] " Jason Wang
2020-01-17 13:58   ` Thomas Gleixner
2020-01-17 14:06     ` Liu, Jiang
2020-01-19  2:27     ` Liu, Jing2
2020-01-19  2:27       ` [virtio-dev] " Liu, Jing2
2020-01-19 14:57       ` Thomas Gleixner
2019-12-25  2:50 ` [PATCH v1 2/2] virtio-mmio: add features for virtio-mmio specification version 3 Zha Bin
2019-12-25 10:20   ` Jason Wang
2019-12-25 10:20     ` [virtio-dev] " Jason Wang
2019-12-25 15:20     ` Liu, Jiang
2019-12-26  8:09       ` Jason Wang
2019-12-26  8:09         ` [virtio-dev] " Jason Wang
2019-12-26 12:35         ` Liu, Jiang
2019-12-26 13:16         ` Liu, Jiang
2020-01-02  6:28           ` Jason Wang
2020-01-02  6:28             ` [virtio-dev] " Jason Wang
2020-01-03  6:50             ` Liu, Jiang
2020-01-05 10:42           ` Michael S. Tsirkin
2020-01-05 10:42             ` [virtio-dev] " Michael S. Tsirkin
2020-01-06  7:24             ` Liu, Jing2
2020-01-06  7:24               ` [virtio-dev] " Liu, Jing2
2020-01-09 16:06             ` Liu, Jiang
2020-01-09 16:47               ` Michael S. Tsirkin
2020-01-09 16:47                 ` [virtio-dev] " Michael S. Tsirkin
2019-12-25 22:28   ` kbuild test robot
2019-12-25 22:28     ` kbuild test robot
2019-12-26  1:44   ` kbuild test robot
2019-12-26  1:44     ` kbuild test robot
2019-12-26  8:40   ` Jason Wang
2019-12-26  8:40     ` [virtio-dev] " Jason Wang
2019-12-27  9:37     ` Liu, Jing2
2019-12-27  9:37       ` Liu, Jing2
2020-01-02  6:33       ` Jason Wang
2020-01-02  6:33         ` Jason Wang
2020-01-02  9:13         ` Liu, Jing2
2020-01-02  9:13           ` Liu, Jing2
2020-01-03  3:24           ` Jason Wang
2020-01-03  3:24             ` Jason Wang
2020-01-03  6:14             ` Liu, Jiang
2020-01-03  9:12               ` Jason Wang
2020-01-03  9:12                 ` Jason Wang
2020-01-05 11:25                 ` Michael S. Tsirkin
2020-01-05 11:25                   ` Michael S. Tsirkin
2020-01-06  2:51                   ` Jason Wang
2020-01-06  2:51                     ` Jason Wang
2020-01-05 11:04   ` Michael S. Tsirkin
2020-01-05 11:04     ` [virtio-dev] " Michael S. Tsirkin
2020-01-09  6:15     ` Liu, Jing2
2020-01-09  6:15       ` [virtio-dev] " Liu, Jing2
2020-01-09 13:26       ` Michael S. Tsirkin
2020-01-09 13:26         ` [virtio-dev] " Michael S. Tsirkin
2020-01-15  7:06     ` Liu, Jing2
2020-01-15  7:06       ` [virtio-dev] " Liu, Jing2
2020-01-21  5:03     ` Liu, Jing2
2020-01-21  5:03       ` Liu, Jing2
2020-01-02  6:55 ` [PATCH v1 0/2] support virtio mmio specification Version 3 Jason Wang
2020-01-02  6:55   ` [virtio-dev] " Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.