From: Yuri Benditovich <yuri.benditovich@daynix.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Yan Vugenfirer <yan@daynix.com>,
pbonzini@redhat.com, Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] virtio: reset region cache when on queue deletion
Date: Sun, 5 Jan 2020 18:21:23 +0200 [thread overview]
Message-ID: <CAOEp5Of0PYiCu9kPyi7W84ToHrGzTHFkPFBGd0A7AVFkwzVZOg@mail.gmail.com> (raw)
In-Reply-To: <20200105063518-mutt-send-email-mst@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3075 bytes --]
On Sun, Jan 5, 2020 at 1:39 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> On Thu, Jan 02, 2020 at 09:09:04AM +0200, Yuri Benditovich wrote:
> >
> >
> > On Thu, Jan 2, 2020 at 1:50 AM Michael S. Tsirkin <mst@redhat.com>
> wrote:
> >
> > On Thu, Dec 26, 2019 at 11:29:50AM +0200, Yuri Benditovich wrote:
> > > On Thu, Dec 26, 2019 at 10:58 AM Jason Wang <jasowang@redhat.com>
> wrote:
> > > >
> > > >
> > > > On 2019/12/26 下午12:36, Yuri Benditovich wrote:
> > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1708480
> > > > > Fix leak of region reference that prevents complete
> > > > > device deletion on hot unplug.
> > > >
> > > >
> > > > More information is needed here, the bug said only q35 can meet
> this
> > > > issue. What makes q35 different here?
> > > >
> > >
> > > I do not have any ready answer, I did not dig into it too much.
> > > Probably Michael Tsirkin or Paolo Bonzini can answer without
> digging.
> >
> >
> >
> > > >
> > > > >
> > > > > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> > > > > ---
> > > > > hw/virtio/virtio.c | 5 +++++
> > > > > 1 file changed, 5 insertions(+)
> > > > >
> > > > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> > > > > index 04716b5f6c..baadec8abc 100644
> > > > > --- a/hw/virtio/virtio.c
> > > > > +++ b/hw/virtio/virtio.c
> > > > > @@ -2340,6 +2340,11 @@ void virtio_del_queue(VirtIODevice
> *vdev, int
> > n)
> > > > > vdev->vq[n].vring.num_default = 0;
> > > > > vdev->vq[n].handle_output = NULL;
> > > > > vdev->vq[n].handle_aio_output = NULL;
> > > > > + /*
> > > > > + * with vring.num = 0 the queue will be ignored
> > > > > + * in later loops of region cache reset
> > > > > + */
> > > >
> > > >
> > > > I can't get the meaning of this comment.
> > > >
> > > > Thanks
> > > >
> > > >
> > > > > + virtio_virtqueue_reset_region_cache(&vdev->vq[n]);
> >
> >
> > Do we need to drop this from virtio_device_free_virtqueues then?
> >
> >
> >
> > Not mandatory. Repetitive virtio_virtqueue_reset_region_cache does not
> do
> > anything bad.
> > Some of virtio devices do not do 'virtio_del_queue' at all. Currently
> > virtio_device_free_virtqueues resets region cache for them.
> > IMO, not calling 'virtio_del_queue' is a bug, but not in the scope of
> current
> > series, I'll take care of that later.
>
> Maybe we should just del all queues in virtio_device_unrealize?
> Will allow us to drop some logic tracking which vqs were created.
>
>
Yes, this is also possible with some rework of
virtio_device_free_virtqueues.
virtio-net has some additional operations around queue deletion, it deletes
queues when switches from single queue to multiple.
>
> >
> > > > > g_free(vdev->vq[n].used_elems);
> > > > > }
> > > > >
> > > >
> >
> >
>
>
[-- Attachment #2: Type: text/html, Size: 4762 bytes --]
next prev parent reply other threads:[~2020-01-05 16:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-26 4:36 [PATCH 0/2] Solve problem of hot removal of virtio-net-pci Yuri Benditovich
2019-12-26 4:36 ` [PATCH 1/2] virtio: reset region cache when on queue deletion Yuri Benditovich
2019-12-26 8:58 ` Jason Wang
2019-12-26 9:29 ` Yuri Benditovich
2020-01-01 23:50 ` Michael S. Tsirkin
2020-01-02 7:09 ` Yuri Benditovich
2020-01-05 11:39 ` Michael S. Tsirkin
2020-01-05 16:21 ` Yuri Benditovich [this message]
2020-01-06 9:10 ` Yuri Benditovich
2020-01-06 9:57 ` Michael S. Tsirkin
2020-01-06 10:37 ` Yuri Benditovich
2020-01-07 10:42 ` Yuri Benditovich
2020-01-05 12:21 ` Michael S. Tsirkin
2020-01-05 16:14 ` Yuri Benditovich
2019-12-26 4:36 ` [PATCH 2/2] virtio-net: delete also control queue when TX/RX deleted Yuri Benditovich
2020-01-01 23:43 ` Michael S. Tsirkin
2020-01-02 6:52 ` Yuri Benditovich
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=CAOEp5Of0PYiCu9kPyi7W84ToHrGzTHFkPFBGd0A7AVFkwzVZOg@mail.gmail.com \
--to=yuri.benditovich@daynix.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yan@daynix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).