]> git.ipfire.org Git - thirdparty/linux.git/commit
virtio-net: add cond_resched() to the command waiting loop
authorJason Wang <jasowang@redhat.com>
Thu, 20 Jul 2023 08:38:39 +0000 (04:38 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 19 Mar 2024 07:19:22 +0000 (03:19 -0400)
commit0d197a14716481626f863d2091f4c328bf5412e3
tree6d62e41a84ddb7f61bc9733cce02e8e4e8397364
parentb9f7425239a09903629f71f719654983481b00aa
virtio-net: add cond_resched() to the command waiting loop

Adding cond_resched() to the command waiting loop for a better
co-operation with the scheduler. This allows to give CPU a breath to
run other task(workqueue) instead of busy looping when preemption is
not allowed on a device whose CVQ might be slow.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20230720083839.481487-3-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
drivers/net/virtio_net.c