On Wednesday, February 5, 2020 12:50 AM, Michael S. Tsirkin wrote:> > Michael, any clue on which event we have to wait with > > VIRTIO_BALLOON_F_MUST_TELL_HOST? IMHO, I don't think > > VIRTIO_BALLOON_F_MUST_TELL_HOST applies to > > VIRTIO_BALLOON_F_FREE_PAGE_HINT and we'd better document that. It > introduces complexity with no clear benefit. > > I meant that we must wait for host to see the hint.Why? Best, Wei
On Wed, Feb 05, 2020 at 06:52:34AM +0000, Wang, Wei W wrote:> On Wednesday, February 5, 2020 12:50 AM, Michael S. Tsirkin wrote: > > > Michael, any clue on which event we have to wait with > > > VIRTIO_BALLOON_F_MUST_TELL_HOST? IMHO, I don't think > > > VIRTIO_BALLOON_F_MUST_TELL_HOST applies to > > > VIRTIO_BALLOON_F_FREE_PAGE_HINT and we'd better document that. It > > introduces complexity with no clear benefit. > > > > I meant that we must wait for host to see the hint. > > Why? > > Best, > WeiWell if we did the hint would be reliable, allowing host to immediately drop any pages it gets in the hint. Originally I wanted to speed up hinting by never waiting for host, but that does not seem to be what was implemented: the only place we don't wait is the shrinker and it seems a waste that we introduced complexity to host without getting any real benefit out of it. VIRTIO_BALLOON_F_MUST_TELL_HOST doesn't really apply to hinting right now, so we could have used it to mean "hints must wait for host to use buffers". I'm afraid it's already a wasted opportunity at this point, reusing it isn't worth the compatibility headaches. -- MST
On Wednesday, February 5, 2020 3:05 PM, Michael S. Tsirkin wrote:> > Well if we did the hint would be reliable, allowing host to immediately drop > any pages it gets in the hint."drop", you mean host to unmap the page from guest? I think that's not allowed for hints.> Originally I wanted to speed up hinting by never > waiting for host, but that does not seem to be what was > implemented: the only place we don't wait is the shrinkerDidn't get this one. For FREE_PAGE_HINT, the hints are always sent to host without an ack from host about whether it has read the hint or not. (please see get_free_page_and_send)> and it seems a > waste that we introduced complexity to host without getting any real > benefit out of it. > > VIRTIO_BALLOON_F_MUST_TELL_HOST doesn't really apply to hinting right > now,There is no need I think, as host isn't allowed to use or unmap the hint page. Best, Wei