From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Parav Pandit <parav@nvidia.com>,
"virtio-comment@lists.oasis-open.org"
<virtio-comment@lists.oasis-open.org>,
"cohuck@redhat.com" <cohuck@redhat.com>,
"sburla@marvell.com" <sburla@marvell.com>,
Shahaf Shuler <shahafs@nvidia.com>,
Maor Gottlieb <maorg@nvidia.com>,
Yishai Hadas <yishaih@nvidia.com>,
"lingshan.zhu@intel.com" <lingshan.zhu@intel.com>
Subject: [virtio-comment] Re: [PATCH v3 6/8] admin: Add theory of operation for write recording commands
Date: Wed, 8 Nov 2023 03:17:18 -0500 [thread overview]
Message-ID: <20231108025854-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CACGkMEv+jir2+f_vHmi_KjFXf0yz+EQmEbvzX0pheHKsVJkWZw@mail.gmail.com>
On Wed, Nov 08, 2023 at 12:28:36PM +0800, Jason Wang wrote:
> On Tue, Nov 7, 2023 at 3:05 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Tue, Nov 07, 2023 at 12:04:29PM +0800, Jason Wang wrote:
> > > > > > Each virtio and non virtio devices who wants to report their dirty page report,
> > > > > will do their way.
> > > > > >
> > > > > > > 3) inventing it in the virtio layer will be deprecated in the future
> > > > > > > for sure, as platform will provide much rich features for logging
> > > > > > > e.g it can do it per PASID etc, I don't see any reason virtio need
> > > > > > > to compete with the features that will be provided by the platform
> > > > > > Can you bring the cpu vendors and committement to virtio tc with timelines
> > > > > so that virtio TC can omit?
> > > > >
> > > > > Why do we need to bring CPU vendors in the virtio TC? Virtio needs to be built
> > > > > on top of transport or platform. There's no need to duplicate their job.
> > > > > Especially considering that virtio can't do better than them.
> > > > >
> > > > I wanted to see a strong commitment for the cpu vendors to support dirty page tracking.
> > >
> > > The RFC of IOMMUFD support can go back to early 2022. Intel, AMD and
> > > ARM are all supporting that now.
> > >
> > > > And the work seems to have started for some platforms.
> > >
> > > Let me quote from the above link:
> > >
> > > """
> > > Today, AMD Milan (or more recent) supports it while ARM SMMUv3.2
> > > alongside VT-D rev3.x also do support.
> > > """
> > >
> > > > Without such platform commitment, virtio also skipping it would not work.
> > >
> > > Is the above sufficient? I'm a little bit more familiar with vtd, the
> > > hw feature has been there for years.
> >
> >
> > Repeating myself - I'm not sure that will work well for all workloads.
>
> I think this comment applies to this proposal as well.
Yes - some systems might be better off with platform tracking.
And I think supporting shadow vq better would be nice too.
> > Definitely KVM did
> > not scan PTEs. It used pagefaults with bit per page and later as VM size
> > grew switched to PLM. This interface is analogous to PLM,
>
> I think you meant PML actually. And it doesn't work like PML. To
> behave like PML it needs to
>
> 1) log buffers were organized as a queue with indices
> 2) device needs to suspend (as a #vmexit in PML) if it runs out of the buffers
> 3) device need to send a notification to the driver if it runs out of the buffer
>
> I don't see any of the above in this proposal. If we do that it would
> be less problematic than what is being proposed here.
What is common between this and PML is that you get the addresses
directly without scanning megabytes of bitmaps or worse -
hundreds of megabytes of page tables.
The data structure is different but I don't see why it is critical.
I agree that I don't see out of buffers notifications too which implies
device has to maintain something like a bitmap internally. Which I
guess could be fine but it is not clear to me how large that bitmap has
to be. How does the device know? Needs to be addressed.
> Even if we manage to do that, it doesn't mean we won't have issues.
>
> 1) For many reasons it can neither see nor log via GPA, so this
> requires a traversal of the vIOMMU mapping tables by the hypervisor
> afterwards, it would be expensive and need synchronization with the
> guest modification of the IO page table which looks very hard.
vIOMMU is fast enough to be used on data path but not fast enough for
dirty tracking? Hard to believe. If true and you want to speed up
vIOMMU then you implement an efficient datastructure for that.
> 2) There are a lot of special or reserved IOVA ranges (for example the
> interrupt areas in x86) that need special care which is architectural
> and where it is beyond the scope or knowledge of the virtio device but
> the platform IOMMU. Things would be more complicated when SVA is
> enabled.
SVA being what here?
> And there could be other architecte specific knowledge (e.g
> PAGE_SIZE) that might be needed. There's no easy way to deal with
> those cases.
Good point about page size actually - using 4k unconditionally
is a waste of resources.
> We wouldn't need to care about all of them if it is done at platform
> IOMMU level.
If someone logs at IOMMU level then nothing needs to be done
in the spec at all. This is about capability at the device level.
> > what Lingshan
> > proposed is analogous to bit per page - problem unfortunately is
> > you can't easily set a bit by DMA.
> >
>
> I'm not saying bit/bytemap is the best, but it has been used by real
> hardware. And we have many other options.
>
> > So I think this dirty tracking is a good option to have.
> >
> >
> >
> > > >
> > > > > > i.e. in first year of 2024?
> > > > >
> > > > > Why does it matter in 2024?
> > > > Because users needs to use it now.
> > > >
> > > > >
> > > > > > If not, we are better off to offer this, and when/if platform support is, sure,
> > > > > this feature can be disabled/not used/not enabled.
> > > > > >
> > > > > > > 4) if the platform support is missing, we can use software or
> > > > > > > leverage transport for assistance like PRI
> > > > > > All of these are in theory.
> > > > > > Our experiment shows PRI performance is 21x slower than page fault rate
> > > > > done by the cpu.
> > > > > > It simply does not even pass a simple 10Gbps test.
> > > > >
> > > > > If you stick to the wire speed during migration, it can converge.
> > > > Do you have perf data for this?
> > >
> > > No, but it's not hard to imagine the worst case. Wrote a small program
> > > that dirty every page by a NIC.
> > >
> > > > In the internal tests we don’t see this happening.
> > >
> > > downtime = dirty_rates * PAGE_SIZE / migration_speed
> > >
> > > So if we get very high dirty rates (e.g by a high speed NIC), we can't
> > > satisfy the requirement of the downtime. Or if you see the converge,
> > > you might get help from the auto converge support by the hypervisors
> > > like KVM where it tries to throttle the VCPU then you can't reach the
> > > wire speed.
> >
> > Will only work for some device types.
> >
>
> Yes, that's the point. Parav said he doesn't see the issue, it's
> probably because he is testing a virtio-net and so the vCPU is
> automatically throttled. It doesn't mean it can work for other virito
> devices.
Only for TX, and I'm pretty sure they had the foresight to test RX not
just TX but let's confirm. Parav did you test both directions?
> >
> >
> > > >
> > > > >
> > > > > > There is no requirement for mandating PRI either.
> > > > > > So it is unusable.
> > > > >
> > > > > It's not about mandating, it's about doing things in the correct layer. If PRI is
> > > > > slow, PCI can evolve for sure.
> > > > You should try.
> > >
> > > Not my duty, I just want to make sure things are done in the correct
> > > layer, and once it needs to be done in the virtio, there's nothing
> > > obviously wrong.
> >
> > Yea but just vague questions don't help to make sure eiter way.
>
> I don't think it's vague, I have explained, if something in the virito
> slows down the PRI, we can try to fix them.
I don't believe you are going to make PRI fast. No one managed so far.
> Missing functions in
> platform or transport is not a good excuse to try to workaround it in
> the virtio. It's a layer violation and we never had any feature like
> this in the past.
Yes missing functionality in the platform is exactly why virtio
was born in the first place.
> >
> > > > In the current state, it is mandating.
> > > > And if you think PRI is the only way,
> > >
> > > I don't, it's just an example where virtio can leverage from either
> > > transport or platform. Or if it's the fault in virtio that slows down
> > > the PRI, then it is something we can do.
> > >
> > > > than you should propose that in the dirty page tracking series that you listed above to not do dirty page tracking. Rather depend on PRI, right?
> > >
> > > No, the point is to not duplicate works especially considering virtio
> > > can't do better than platform or transport.
> >
> > If someone says they tried and platform's migration support does not
> > work for them and they want to build a solution in virtio then
> > what exactly is the objection?
>
> The discussion is to make sure whether virtio can do this easily and
> correctly, then we can have a conclusion. I've stated some issues
> above, and I've asked other questions related to them which are still
> not answered.
>
> I think we had a very hard time in bypassing IOMMU in the past that we
> don't want to repeat.
>
> We've gone through several methods of logging dirty pages in the past
> (each with pros/cons), but this proposal never explains why it chooses
> one of them but not others. Spec needs to find the best path instead
> of just a possible path without any rationale about why.
Adding more rationale isn't a bad thing.
In particular if platform supplies dirty tracking then how does
driver decide which to use platform or device capability?
A bit of discussion around this is a good idea.
> > virtio is here in the
> > first place because emulating devices didn't work well.
>
> I don't understand here. We have supported emulated devices for years.
> I'm pretty sure a lot of issues could be uncovered if this proposal
> can be prototyped with an emulated device first.
>
> Thanks
virtio was originally PV as opposed to emulation. That there's now
hardware virtio and you call software implementation "an emulation" is
very meta.
>
>
>
>
> >
> > --
> > MST
> >
This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.
Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
next prev parent reply other threads:[~2023-11-08 8:17 UTC|newest]
Thread overview: 157+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 13:19 [virtio-comment] [PATCH v3 0/8] Introduce device migration support commands Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 1/8] admin: Add theory of operation for device migration Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 2/8] admin: Redefine reserved2 as command specific output Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 3/8] device-context: Define the device context fields for device migration Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 4/8] admin: Add device migration admin commands Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 5/8] admin: Add requirements of device migration commands Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 6/8] admin: Add theory of operation for write recording commands Parav Pandit
2023-10-31 1:43 ` [virtio-comment] " Jason Wang
2023-10-31 3:27 ` [virtio-comment] " Parav Pandit
2023-10-31 7:45 ` [virtio-comment] " Michael S. Tsirkin
2023-10-31 9:32 ` Zhu, Lingshan
2023-10-31 9:41 ` Michael S. Tsirkin
2023-10-31 9:47 ` Zhu, Lingshan
2023-11-01 0:29 ` Jason Wang
2023-11-01 3:02 ` [virtio-comment] " Parav Pandit
2023-11-02 4:24 ` [virtio-comment] " Jason Wang
2023-11-02 6:10 ` [virtio-comment] " Parav Pandit
2023-11-06 6:34 ` [virtio-comment] " Jason Wang
2023-11-06 6:53 ` [virtio-comment] " Parav Pandit
2023-11-07 4:04 ` [virtio-comment] " Jason Wang
2023-11-07 7:05 ` Michael S. Tsirkin
2023-11-08 4:28 ` Jason Wang
2023-11-08 8:17 ` Michael S. Tsirkin [this message]
2023-11-08 9:00 ` [virtio-comment] " Parav Pandit
2023-11-08 17:16 ` [virtio-comment] " Michael S. Tsirkin
2023-11-09 6:27 ` Parav Pandit
2023-11-09 3:31 ` Jason Wang
2023-11-09 7:59 ` Michael S. Tsirkin
2023-11-10 6:46 ` [virtio-comment] " Parav Pandit
2023-11-13 3:41 ` [virtio-comment] " Jason Wang
2023-11-13 14:30 ` Michael S. Tsirkin
2023-11-14 2:03 ` Zhu, Lingshan
2023-11-14 7:52 ` Jason Wang
2023-11-15 17:37 ` [virtio-comment] " Parav Pandit
2023-11-16 4:24 ` [virtio-comment] " Jason Wang
2023-11-16 6:49 ` Michael S. Tsirkin
2023-11-21 4:21 ` Jason Wang
2023-11-21 16:24 ` [virtio-comment] " Parav Pandit
2023-11-22 4:11 ` [virtio-comment] " Jason Wang
2023-11-16 6:50 ` Michael S. Tsirkin
2023-11-13 3:31 ` Jason Wang
2023-11-13 6:57 ` Michael S. Tsirkin
2023-11-14 7:34 ` Zhu, Lingshan
2023-11-14 7:59 ` Jason Wang
2023-11-14 8:27 ` Michael S. Tsirkin
2023-11-15 4:05 ` Zhu, Lingshan
2023-11-15 7:51 ` Michael S. Tsirkin
2023-11-15 7:59 ` Zhu, Lingshan
2023-11-15 8:05 ` Michael S. Tsirkin
2023-11-15 8:42 ` Zhu, Lingshan
2023-11-15 11:52 ` Michael S. Tsirkin
2023-11-16 9:38 ` Zhu, Lingshan
2023-11-16 12:18 ` Michael S. Tsirkin
2023-11-17 9:50 ` Zhu, Lingshan
2023-11-17 9:55 ` Michael S. Tsirkin
2023-11-14 7:57 ` Jason Wang
2023-11-14 9:16 ` Michael S. Tsirkin
2023-11-15 17:42 ` [virtio-comment] " Parav Pandit
2023-11-16 4:18 ` [virtio-comment] " Jason Wang
2023-11-16 5:27 ` [virtio-comment] " Parav Pandit
2023-11-17 10:15 ` [virtio-comment] " Michael S. Tsirkin
2023-11-17 10:48 ` Parav Pandit
2023-11-17 11:19 ` Michael S. Tsirkin
2023-11-17 11:32 ` Parav Pandit
2023-11-17 11:49 ` Michael S. Tsirkin
2023-11-17 12:15 ` Parav Pandit
2023-11-17 12:37 ` Michael S. Tsirkin
2023-11-17 12:49 ` Parav Pandit
2023-11-17 13:58 ` Michael S. Tsirkin
2023-11-17 14:49 ` Parav Pandit
2023-11-17 15:00 ` Michael S. Tsirkin
2023-11-09 6:26 ` [virtio-comment] " Parav Pandit
2023-11-15 7:59 ` [virtio-comment] " Michael S. Tsirkin
2023-11-15 17:42 ` [virtio-comment] " Parav Pandit
2023-11-09 6:24 ` Parav Pandit
2023-11-13 3:37 ` [virtio-comment] " Jason Wang
2023-11-15 17:38 ` [virtio-comment] " Parav Pandit
2023-11-16 4:23 ` [virtio-comment] " Jason Wang
2023-11-16 5:29 ` [virtio-comment] " Parav Pandit
2023-11-16 5:51 ` [virtio-comment] " Michael S. Tsirkin
2023-11-16 7:35 ` Michael S. Tsirkin
2023-11-16 7:40 ` [virtio-comment] " Parav Pandit
2023-11-16 11:48 ` [virtio-comment] " Michael S. Tsirkin
2023-11-16 16:26 ` [virtio-comment] " Parav Pandit
2023-11-16 17:25 ` [virtio-comment] " Michael S. Tsirkin
2023-11-16 17:29 ` [virtio-comment] " Parav Pandit
2023-11-16 18:20 ` [virtio-comment] " Michael S. Tsirkin
2023-11-17 3:02 ` [virtio-comment] " Parav Pandit
2023-11-17 8:46 ` [virtio-comment] " Michael S. Tsirkin
2023-11-17 9:14 ` [virtio-comment] " Parav Pandit
2023-11-17 9:37 ` [virtio-comment] " Michael S. Tsirkin
2023-11-17 9:41 ` [virtio-comment] " Parav Pandit
2023-11-17 9:44 ` Parav Pandit
2023-11-17 9:51 ` [virtio-comment] " Michael S. Tsirkin
2023-11-17 9:54 ` Zhu, Lingshan
2023-11-17 10:02 ` Michael S. Tsirkin
2023-11-17 10:10 ` Parav Pandit
2023-11-17 9:57 ` Parav Pandit
2023-11-17 10:37 ` Michael S. Tsirkin
2023-11-17 10:52 ` Parav Pandit
2023-11-17 11:32 ` Michael S. Tsirkin
2023-11-17 12:22 ` Parav Pandit
2023-11-17 12:40 ` Michael S. Tsirkin
2023-11-17 12:51 ` Parav Pandit
2023-11-21 5:16 ` Jason Wang
2023-11-21 16:29 ` Parav Pandit
2023-11-21 21:00 ` Michael S. Tsirkin
2023-11-22 3:46 ` Parav Pandit
2023-11-22 7:44 ` Michael S. Tsirkin
2023-11-22 4:17 ` Jason Wang
2023-11-22 4:34 ` Parav Pandit
2023-11-24 3:15 ` Jason Wang
2023-11-17 9:52 ` Zhu, Lingshan
2023-11-17 9:59 ` [virtio-comment] " Parav Pandit
2023-11-17 10:00 ` [virtio-comment] " Zhu, Lingshan
2023-11-21 4:24 ` Jason Wang
2023-11-21 16:26 ` [virtio-comment] " Parav Pandit
2023-11-22 4:14 ` [virtio-comment] " Jason Wang
2023-11-22 4:19 ` [virtio-comment] " Parav Pandit
2023-11-24 3:09 ` [virtio-comment] " Jason Wang
2023-11-16 10:28 ` Zhu, Lingshan
2023-11-16 11:59 ` Michael S. Tsirkin
2023-11-17 9:59 ` Zhu, Lingshan
2023-11-17 10:03 ` Parav Pandit
2023-11-17 11:00 ` Michael S. Tsirkin
2023-11-17 11:05 ` Parav Pandit
2023-11-17 11:33 ` Michael S. Tsirkin
2023-11-17 11:45 ` Parav Pandit
2023-11-17 12:04 ` Michael S. Tsirkin
2023-11-17 12:11 ` Parav Pandit
2023-11-17 12:32 ` Michael S. Tsirkin
2023-11-17 13:03 ` Parav Pandit
2023-11-17 14:00 ` Michael S. Tsirkin
2023-11-17 14:48 ` Parav Pandit
2023-11-17 14:59 ` Michael S. Tsirkin
2023-11-21 6:55 ` Jason Wang
2023-11-21 16:30 ` Parav Pandit
2023-11-22 4:19 ` Jason Wang
2023-11-22 4:28 ` Parav Pandit
2023-11-24 3:08 ` Jason Wang
2023-11-22 2:31 ` Si-Wei Liu
2023-11-22 5:31 ` Jason Wang
2023-11-23 13:19 ` Si-Wei Liu
2023-11-23 14:39 ` Michael S. Tsirkin
2023-11-24 2:29 ` Jason Wang
2023-11-28 3:00 ` Si-Wei Liu
2023-11-29 5:12 ` Jason Wang
2023-11-17 10:40 ` Michael S. Tsirkin
2023-11-21 4:23 ` Jason Wang
2023-11-21 7:14 ` Jason Wang
2023-11-21 16:31 ` [virtio-comment] " Parav Pandit
2023-11-22 4:28 ` [virtio-comment] " Jason Wang
2023-11-22 6:41 ` [virtio-comment] " Parav Pandit
2023-11-24 3:06 ` [virtio-comment] " Jason Wang
2023-11-15 7:58 ` Michael S. Tsirkin
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 7/8] admin: Add " Parav Pandit
2023-10-30 13:19 ` [virtio-comment] [PATCH v3 8/8] admin: Add requirements of write reporting commands Parav Pandit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231108025854-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=cohuck@redhat.com \
--cc=jasowang@redhat.com \
--cc=lingshan.zhu@intel.com \
--cc=maorg@nvidia.com \
--cc=parav@nvidia.com \
--cc=sburla@marvell.com \
--cc=shahafs@nvidia.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.