qemu-stable
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]