From: "Michael S. Tsirkin" <mst@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: "virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
"jasowang@redhat.com" <jasowang@redhat.com>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"NBU-Contact-Li Rongqing (EXTERNAL)" <lirongqing@baidu.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: Re: [PATCH] Revert "virtio_pci: Support surprise removal of virtio pci device"
Date: Wed, 9 Apr 2025 12:02:18 -0400 [thread overview]
Message-ID: <20250409115557-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CY8PR12MB71957D9729A72B8BD76513C0DCB42@CY8PR12MB7195.namprd12.prod.outlook.com>
On Wed, Apr 09, 2025 at 01:50:18PM +0000, Parav Pandit wrote:
> Hi Michael,
>
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Wednesday, April 9, 2025 1:45 AM
> >
> > On Tue, Apr 08, 2025 at 05:59:08PM +0300, Parav Pandit wrote:
> > > This reverts commit 43bb40c5b926 ("virtio_pci: Support surprise removal of
> > virtio pci device").
> > >
> > > The cited commit introduced a fix that marks the device as broken
> > > during surprise removal. However, this approach causes uncompleted I/O
> > > requests on virtio-blk device. The presence of uncompleted I/O
> > > requests prevents the successful removal of virtio-blk devices.
> > >
> > > This fix allows devices that simulate a surprise removal but actually
> > > remove gracefully to continue working as before.
> > >
> > > For surprise removals, a better solution will be preferred in the future.
> >
> > Sorry I'm not breaking one thing to fix another.
> > Device is gone so no new requests will be completed. Why not complete all
> > unfinished requests, for example?
> >
> > Come up with a proper fix pls.
> >
> I would also like to have a proper fix that can be backportable.
> However, an attempt [1] had race.
> To overcome the race, a different approach also tried, however the block layer was stuck even if all requests in virtio-blk driver layer was completed like you suggested.
>
> It appeared that supporting uncompleted requests won't be so straightforward to backport.
>
> Hence, the request is to revert and restore the previous behavior.
> This at least improves the case where the OS thinks that surprise removal occurred, but the device eventually completes the IO.
> And hence, virtio block driver successfully unloads.
> And virtio-net also does not experience the mentioned crash.
>
> [1] https://lore.kernel.org/all/20240217180848.241068-1-parav@nvidia.com/
Parav this is a commit from 2021. I am not reverting it "because it
seems to help". We'll never make progress like this.
You will have to debug and fix it properly. Sorry.
Once we have a fix, we will worry about backports and stuff, this
is how we do kernel development here.
> > >
> > > Fixes: 43bb40c5b926 ("virtio_pci: Support surprise removal of virtio
> > > pci device")
> > > Cc: stable@vger.kernel.org
> > > Reported-by: lirongqing@baidu.com
> > > Closes:
> > > https://lore.kernel.org/virtualization/c45dd68698cd47238c55fb73ca9b474
> > > 1@baidu.com/
> > > Reviewed-by: Max Gurtovoy<mgurtovoy@nvidia.com>
> > > Signed-off-by: Parav Pandit <parav@nvidia.com>
> >
> >
> > > ---
> > > drivers/virtio/virtio_pci_common.c | 7 -------
> > > 1 file changed, 7 deletions(-)
> > >
> > > diff --git a/drivers/virtio/virtio_pci_common.c
> > > b/drivers/virtio/virtio_pci_common.c
> > > index d6d79af44569..dba5eb2eaff9 100644
> > > --- a/drivers/virtio/virtio_pci_common.c
> > > +++ b/drivers/virtio/virtio_pci_common.c
> > > @@ -747,13 +747,6 @@ static void virtio_pci_remove(struct pci_dev
> > *pci_dev)
> > > struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
> > > struct device *dev = get_device(&vp_dev->vdev.dev);
> > >
> > > - /*
> > > - * Device is marked broken on surprise removal so that virtio upper
> > > - * layers can abort any ongoing operation.
> > > - */
> > > - if (!pci_device_is_present(pci_dev))
> > > - virtio_break_device(&vp_dev->vdev);
> > > -
> > > pci_disable_sriov(pci_dev);
> > >
> > > unregister_virtio_device(&vp_dev->vdev);
> > > --
> > > 2.26.2
next prev parent reply other threads:[~2025-04-09 16:02 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 14:59 [PATCH] Revert "virtio_pci: Support surprise removal of virtio pci device" Parav Pandit
2025-04-08 20:15 ` Michael S. Tsirkin
2025-04-09 13:50 ` Parav Pandit
2025-04-09 16:02 ` Michael S. Tsirkin [this message]
2025-04-16 3:01 ` Parav Pandit
-- strict thread matches above, loose matches on Subject: below --
2025-08-22 9:17 Parav Pandit
2025-08-22 10:21 ` Michael S. Tsirkin
2025-08-22 12:22 ` Parav Pandit
2025-08-22 13:03 ` Michael S. Tsirkin
2025-08-22 13:49 ` Parav Pandit
2025-08-22 13:59 ` Michael S. Tsirkin
2025-08-24 2:36 ` Parav Pandit
2025-08-24 14:33 ` Michael S. Tsirkin
2025-08-26 18:52 ` Parav Pandit
2025-08-27 10:19 ` Michael S. Tsirkin
2025-08-27 11:33 ` Cornelia Huck
2025-08-28 6:24 ` Parav Pandit
2025-08-28 12:16 ` Cornelia Huck
2025-08-28 12:19 ` Michael S. Tsirkin
2025-08-28 12:22 ` Cornelia Huck
2025-08-28 12:33 ` Parav Pandit
2025-08-28 13:00 ` Michael S. Tsirkin
2025-08-28 13:37 ` Parav Pandit
2025-08-22 10:27 Li,Rongqing
2025-08-22 12:24 ` Parav Pandit
2025-08-22 13:04 ` Michael S. Tsirkin
2025-08-22 13:53 ` Parav Pandit
2025-08-22 14:02 ` Michael S. Tsirkin
2025-08-24 2:36 ` Parav Pandit
2025-08-24 14:29 ` Michael S. Tsirkin
2025-08-26 18:52 ` Parav Pandit
2025-08-27 10:21 ` Michael S. Tsirkin
2025-08-27 10:49 ` Michael S. Tsirkin
2025-08-28 6:23 ` Parav Pandit
2025-08-28 6:34 ` Michael S. Tsirkin
2025-08-28 6:59 ` Parav Pandit
2025-08-28 9:23 ` Michael S. Tsirkin
2025-08-28 10:41 ` 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=20250409115557-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=lirongqing@baidu.com \
--cc=mgurtovoy@nvidia.com \
--cc=parav@nvidia.com \
--cc=pbonzini@redhat.com \
--cc=stable@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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).