Re: [PATCH v3 00/21] KVM: Dirty ring interface

From: Michael S. Tsirkin
Date: Thu Jan 09 2020 - 17:21:12 EST


On Thu, Jan 09, 2020 at 09:51:50PM +0100, Paolo Bonzini wrote:
> On 09/01/20 20:13, Michael S. Tsirkin wrote:
> > That's one of the reasons I called for using something
> > resembling vring_packed_desc.
>
> In principle it could make sense to use the ring-wrap detection
> mechanism from vring_packed_desc instead of the producer/consumer
> indices. However, the element address/length indirection is unnecessary.
>
> Also, unlike virtio, KVM needs to know if there are N free entries (N is
> ~512) before running a guest. I'm not sure if that is possible with
> ring-wrap counters, while it's trivial with producer/consumer indices.
>
> Paolo

Yes it's easy: just check whether current entry + 500 has been consumed.
Unless scatter/father is used, but then the answer is simple - just
don't use it :)

--
MST