]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
vhost: introduce vhost_exceeds_weight()
authorJason Wang <jasowang@redhat.com>
Thu, 8 Aug 2019 04:43:32 +0000 (04:43 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:11:36 +0000 (14:11 +0200)
commit99a79c62cf77220ac8391e1037a600929b816728
tree17511cec41f466312a666cad99e77a49d8c6a017
parent9d89912daf8a5bf6b11a6d653b845353125c675c
vhost: introduce vhost_exceeds_weight()

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>
CVE-2019-3900

(cherry picked from commit e82b9b0727ff6d665fff2d326162b460dded554d)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@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