android_kernel_oneplus_msm8998/drivers/vhost
Jason Wang 9e0b340632 vhost: introduce vhost_exceeds_weight()
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>
[bwh: Backported to 4.4:
 - Drop changes to vhost_vsock
 - In vhost_net, both Tx modes are handled in one loop in handle_tx()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-06 10:18:12 +02:00
..
Kconfig
Makefile
net.c vhost: introduce vhost_exceeds_weight() 2019-09-06 10:18:12 +02:00
scsi.c vhost: introduce vhost_exceeds_weight() 2019-09-06 10:18:12 +02:00
test.c vhost: move features to core 2015-09-16 12:48:07 +03:00
test.h
vhost.c vhost: introduce vhost_exceeds_weight() 2019-09-06 10:18:12 +02:00
vhost.h vhost: introduce vhost_exceeds_weight() 2019-09-06 10:18:12 +02:00
vringh.c