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>
Showing
- drivers/vhost/net.c 6 additions, 16 deletionsdrivers/vhost/net.c
- drivers/vhost/scsi.c 8 additions, 1 deletiondrivers/vhost/scsi.c
- drivers/vhost/vhost.c 19 additions, 1 deletiondrivers/vhost/vhost.c
- drivers/vhost/vhost.h 4 additions, 1 deletiondrivers/vhost/vhost.h
- drivers/vhost/vsock.c 11 additions, 1 deletiondrivers/vhost/vsock.c
Loading
Please register or sign in to comment