All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/14] vhost: multiple worker support
@ 2021-04-28 22:36 Mike Christie
  2021-04-28 22:37 ` [PATCH RFC 01/14] vhost: remove work arg from vhost_work_flush Mike Christie
                   ` (15 more replies)
  0 siblings, 16 replies; 23+ messages in thread
From: Mike Christie @ 2021-04-28 22:36 UTC (permalink / raw)
  To: stefanha, pbonzini, jasowang, mst, sgarzare, virtualization

The following patches apply over mst's vhost branch and were tested
againt that branch and also mkp's 5.13 branch which has some vhost-scsi
changes.

These patches allow us to support multiple vhost workers per device. I
ended up just doing Stefan's original idea where userspace has the
kernel create a worker and we pass back the pid. This has the benefit
over the workqueue and userspace thread approach where we only have
one'ish code path in the kernel.

The kernel patches here allow us to then do N workers device and also
share workers across devices.

I included a patch for qemu so you can get an idea of how it works.

TODO:
-----
- polling
- Allow sharing workers across devices. Kernel support is added and I
hacked up userspace to test, but I'm still working on a sane way to
manage it in userspace.
- Bind to specific CPUs. Commands like "virsh emulatorpin" work with
these patches and allow us to set the group of vhost threads to different
CPUs. But we can also set a specific vq's worker to run on a CPU.
- I'm handling old kernel by just checking for EPERM. Does this require
a feature?

Results:
--------
When running with the null_blk driver and vhost-scsi I can get 1.2
million IOPs by just running a simple

fio --filename=/dev/sda --direct=1 --rw=randrw --bs=4k --ioengine=libaio
--iodepth=128  --numjobs=8 --time_based --group_reporting --name=iops
--runtime=60 --eta-newline=1

The VM has 8 vCPUs and sda has 8 virtqueues and we can do a total of
1024 cmds per devices. To get 1.2 million IOPs I did have to tune and
ran the virsh emulatorpin command so the vhost threads were running
on different CPUs than the VM. If the vhost threads share CPUs then I
get around 800K.

For a more real device that are also CPU hogs like iscsi, I can still
get 1 million IOPs using 1 dm-multipath device over 8 iscsi paths
(natively it gets 1.1 million IOPs).



_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2021-05-05 11:13 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 22:36 [PATCH RFC 00/14] vhost: multiple worker support Mike Christie
2021-04-28 22:37 ` [PATCH RFC 01/14] vhost: remove work arg from vhost_work_flush Mike Christie
2021-04-28 22:37 ` [PATCH RFC 1/1] QEMU vhost-scsi: add support for VHOST_SET_VRING_WORKER Mike Christie
2021-04-28 22:37 ` [PATCH RFC 02/14] vhost-scsi: remove extra flushes Mike Christie
2021-04-28 22:37 ` [PATCH RFC 03/14] vhost-scsi: reduce flushes during endpoint clearing Mike Christie
2021-04-28 22:37 ` [PATCH RFC 04/14] vhost: fix poll coding style Mike Christie
2021-04-28 22:37 ` [PATCH RFC 05/14] vhost: move worker thread fields to new struct Mike Christie
2021-04-28 22:37 ` [PATCH RFC 06/14] vhost: move vhost worker creation to kick setup Mike Christie
2021-04-28 22:37 ` [PATCH RFC 07/14] vhost: modify internal functions to take a vhost_worker Mike Christie
2021-04-28 22:37 ` [PATCH RFC 08/14] vhost: allow vhost_polls to use different vhost_workers Mike Christie
2021-04-28 22:37 ` [PATCH RFC 09/14] vhost-scsi: flush IO vqs then send TMF rsp Mike Christie
2021-04-28 22:37 ` [PATCH RFC 10/14] vhost-scsi: make SCSI cmd completion per vq Mike Christie
2021-04-28 22:37 ` [PATCH RFC 11/14] vhost: allow userspace to create workers Mike Christie
2021-05-04 15:30   ` Stefano Garzarella
2021-05-04 18:45     ` Mike Christie
2021-04-28 22:37 ` [PATCH RFC 12/14] vhost: add vhost_dev pointer to vhost_work Mike Christie
2021-05-04 15:33   ` Stefano Garzarella
2021-05-04 18:49     ` Mike Christie
2021-04-28 22:37 ` [PATCH RFC 13/14] vhost: support sharing workers across devs Mike Christie
2021-04-28 22:37 ` [PATCH RFC 14/14] vhost: allow userspace to query vq worker mappings Mike Christie
2021-05-04 15:56 ` [PATCH RFC 00/14] vhost: multiple worker support Stefano Garzarella
2021-05-04 20:11   ` Mike Christie
2021-05-05 11:13     ` Stefano Garzarella

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.