Re: [PATCH] VIRTIO_F_USED_EVENT_AUTO_DISABLE: add new used buffer notification suppression mechanism

Michael S. Tsirkin
2024-07-03T08:28:35Z

On Wed, Jul 03, 2024 at 06:52:03AM +0000, Lege Wang wrote:
> > > +
> > > \subsubsection{ISR status capability}\label{sec:Virtio Transport Options /
> > Virtio Over PCI Bus / PCI Device Layout / ISR status capability}
> > >
> > > The VIRTIO_PCI_CAP_ISR_CFG capability
> >
> >
> > After reading this and the text, I can't figure out how is this feature
> > supposed to work without races. What if the device uses a buffer while
> > the driver notification is in flight to the device?
> Hmm, I think it doesn't matter, Only the used buffer enable notification is
> transmitted to device successfully, device starts to judge whether it's time
> to send used buffer notification to driver according to its internal interrupt policy.

I don't understand what you are saying. If device has some magical
interrupt policy why do we need a notification from the driver
at all.

Conversely, if device relies on the notification and thinks that an
interrupt is not needed (because it did not get the notification yet),
while at the same time the driver is blocked waiting for an interrupt,
we get a deadlock.

--
MST