android_kernel_samsung_a7y1.../drivers/vhost
Jason Wang adf0feca89 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>
2020-04-06 21:24:49 +02:00
..
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.vringh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net.c vhost: introduce vhost_exceeds_weight() 2020-04-06 21:24:49 +02:00
scsi.c vhost: introduce vhost_exceeds_weight() 2020-04-06 21:24:49 +02:00
test.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vhost.c vhost: introduce vhost_exceeds_weight() 2020-04-06 21:24:49 +02:00
vhost.h vhost: introduce vhost_exceeds_weight() 2020-04-06 21:24:49 +02:00
vringh.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vsock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30