Re: [PATCH RESEND v2 00/17] KVM: Dirty ring interface

From: Jason Wang
Date: Tue Dec 24 2019 - 01:35:19 EST



On 2019/12/21 äå9:49, Peter Xu wrote:
* Why not virtio?

There's already some discussion during v1 patchset on whether it's
good to use virtio for the data path of delivering dirty pages [1].
I'd confess the only thing that we might consider to use is the vring
layout (because virtqueue is tightly bound to devices, while we don't
have a device contet here), however it's a pity that even we only use
the most low-level vring api it'll be at least iov based which is
already an overkill for dirty ring (which is literally an array of
addresses). So I just kept things easy.


If iov is the only reason, we can simple extend vringh helper to access the descriptor directly.

For split ring, it has some redundant stuffs.

- dirty ring has simple assumption used_idx = last_avail_idx (which is fetch_index), so no need for having two rings
- descriptor is self contained (dirty_gfns), no need to another indirection (but we can reuse vring descriptors for sure)

For packed ring, it looks not, but I'm not sure it's worthwhile to try.

Thanks