[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/6] virtio-scsi: don't waste CPU polling the event virtqueue
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH 2/6] virtio-scsi: don't waste CPU polling the event virtqueue |
Date: |
Sat, 30 Apr 2022 06:52:45 +0100 |
On Fri, Apr 29, 2022 at 01:17:05AM +0200, Paolo Bonzini wrote:
> On 4/27/22 16:35, Stefan Hajnoczi wrote:
> > This is typical for rx virtqueues where the device uses buffers when
> > some event occurs (e.g. a packet is received, an error condition
> > happens, etc).
> >
> > Polling non-empty virtqueues wastes CPU cycles. We are not waiting for
> > new buffers to become available, we are waiting for an event to occur,
> > so it's a misuse of CPU resources to poll for buffers.
>
> Shouldn't polling wait for _used_ buffers, rather than available ones?
>
> I agree that it's generally useless to poll the event queue, but not because
> it doesn't empty the virtqueue.
This is device emulation code, not driver code. It's the device that
uses buffers and the driver that waits for used buffers. So the device
shouldn't poll for used buffers.
Stefan
signature.asc
Description: PGP signature
- [PATCH 0/6] virtio-scsi: fix 100% CPU consumption in IOThread, Stefan Hajnoczi, 2022/04/27
- [PATCH 1/6] virtio-scsi: fix ctrl and event handler functions in dataplane mode, Stefan Hajnoczi, 2022/04/27
- [PATCH 2/6] virtio-scsi: don't waste CPU polling the event virtqueue, Stefan Hajnoczi, 2022/04/27
- [PATCH 3/6] virtio-scsi: clean up virtio_scsi_handle_event_vq(), Stefan Hajnoczi, 2022/04/27
- [PATCH 5/6] virtio-scsi: clean up virtio_scsi_handle_cmd_vq(), Stefan Hajnoczi, 2022/04/27
- [PATCH 4/6] virtio-scsi: clean up virtio_scsi_handle_ctrl_vq(), Stefan Hajnoczi, 2022/04/27
- [PATCH 6/6] virtio-scsi: move request-related items from .h to .c, Stefan Hajnoczi, 2022/04/27