]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vhost: introduce vhost_exceeds_weight()
authorJason Wang <jasowang@redhat.com>
Fri, 17 May 2019 04:29:49 +0000 (00:29 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit9564f70cfd8011087000e3d1f9183e7fec29d0ec
tree984182b273e39da9e8eca9dae6eeaa9c3e683685
parentc2528eb571623c4c7ba20e4e375ede07b0f6333c
vhost: introduce vhost_exceeds_weight()

BugLink: https://bugs.launchpad.net/bugs/1838824
commit e82b9b0727ff6d665fff2d326162b460dded554d upstream.

We used to have vhost_exceeds_weight() for vhost-net to:

- prevent vhost kthread from hogging the cpu
- balance the time spent between TX and RX

This function could be useful for vsock and scsi as well. So move it
to vhost.c. Device must specify a weight which counts the number of
requests, or it can also specific a byte_weight which counts the
number of bytes that has been processed.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Balbir Singh <sblbir@amzn.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/vhost/net.c
drivers/vhost/scsi.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h
drivers/vhost/vsock.c