RFC vhost: allow userspace to control vq cpu affinity
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest8 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | vhost: remove work arg from vhost_work_flushdrivers/ drivers/ drivers/ +1 more | +8 | 0 replies | |
| 2/8 | vhost-scsi: remove extra flushesdrivers/ | +0 | 0 replies | |
| 3/8 | vhost poll: fix coding styledrivers/ | +6 | 0 replies | |
| 4/8 | vhost: move msg_handler to new ops structdrivers/ drivers/ drivers/ | +15 | 0 replies | |
| 5/8 | vhost: allow userspace to bind vqs to CPUsdrivers/ drivers/ drivers/ +1 more | +129 | 5 replies | |
| 6/8 | vhost-scsi: make SCSI cmd completion per vqdrivers/ | +25 | 0 replies | |
| 7/8 | vhost, vhost-scsi: flush IO vqs then send TMF rspdrivers/ drivers/ drivers/ | +28 | 0 replies | |
| 8/8 | vhost-scsi: hook vhost-scsi into vring set cpu supportdrivers/ | +13 | 0 replies |
Reviews trailers per patch
3 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Stefan Hajnoczi | Chaitanya Kulkarni | Jason Wang |
|---|---|---|---|
| 1/8 | R-b | A-b | |
| 2/8 | R-b | ||
| 3/8 | R-b | R-b | |
| 4/8 | |||
| 5/8 | |||
| 6/8 | |||
| 7/8 | |||
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [RFC PATCH 0/8] vhost: allow userspace to control vq cpu affinity
These patches were made over mst's vhost branch.
The following patches, made over mst's vhost branch, allow userspace to set each vq's cpu affinity. Currently, with cgroups the worker thread inherits the affinity settings, but we are at the mercy of the CPU scheduler for where the vq's IO will be executed on. This can result in the scheduler sometimes hammering a couple queues on the host instead of spreading it out like how the guest's app might have intended if it was mq aware.
This version of the patches is not what you guys were talking about initially like with the interface that was similar to nbd's old (3.x kernel days) NBD_DO_IT ioctl where userspace calls down to the kernel and we run from that context. These patches instead just allow userspace to tell the kernel which CPU a vq should run on. We then use the kernel's workqueue code to handle the thread management.
I wanted to post this version first, because it is flexible in that userspace can set things up so devs/vqs share threads/CPUs and we don't have to worry about replicating a bunch of features that the workqueue code already has like dynamic thread creation, blocked work detection, idle thread detection and thread reaping, and it also has an interface to control how many threads can be created and which CPUs work can run on if we want to further restrict that from userspace.
Note that these patches have been lightly tested. I more wanted to get comments on the overall approach, because I know it's not really what you were thinking about. But while I worked on being able to share threads with multiple devices, I kept coming back to the existing workqueue code and thinking I'll just copy and paste that.