[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6ce5f07-2154-2ca2-3438-5fdf5318cea5@linux.ibm.com>
Date: Thu, 3 Nov 2022 19:24:16 -0400
From: Matthew Rosato <mjrosato@...ux.ibm.com>
To: Eric Farman <farman@...ux.ibm.com>,
Alex Williamson <alex.williamson@...hat.com>,
Cornelia Huck <cohuck@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
Kevin Tian <kevin.tian@...el.com>, Yi Liu <yi.l.liu@...el.com>
Cc: Zhenyu Wang <zhenyuw@...ux.intel.com>,
Zhi Wang <zhi.a.wang@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Halil Pasic <pasic@...ux.ibm.com>,
Vineeth Vijayan <vneethv@...ux.ibm.com>,
Peter Oberparleiter <oberpar@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Tony Krowiak <akrowiak@...ux.ibm.com>,
Jason Herne <jjherne@...ux.ibm.com>,
Harald Freudenberger <freude@...ux.ibm.com>,
Diana Craciun <diana.craciun@....nxp.com>,
Eric Auger <eric.auger@...hat.com>,
Kirti Wankhede <kwankhede@...dia.com>,
Abhishek Sahu <abhsahu@...dia.com>,
Yishai Hadas <yishaih@...dia.com>,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
kvm@...r.kernel.org
Subject: Re: [PATCH v2 5/7] vfio/ccw: remove release completion
On 11/2/22 11:01 AM, Eric Farman wrote:
> There's enough separation between the parent and private structs now,
> that it is fine to remove the release completion hack.
>
> Signed-off-by: Eric Farman <farman@...ux.ibm.com>
> Reviewed-by: Kevin Tian <kevin.tian@...el.com>
Reviewed-by: Matthew Rosato <mjrosato@...ux.ibm.com>
> ---
> drivers/s390/cio/vfio_ccw_ops.c | 14 +-------------
> drivers/s390/cio/vfio_ccw_private.h | 3 ---
> 2 files changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/drivers/s390/cio/vfio_ccw_ops.c b/drivers/s390/cio/vfio_ccw_ops.c
> index e45d4acb109b..8a929a9cf3c6 100644
> --- a/drivers/s390/cio/vfio_ccw_ops.c
> +++ b/drivers/s390/cio/vfio_ccw_ops.c
> @@ -54,7 +54,6 @@ static int vfio_ccw_mdev_init_dev(struct vfio_device *vdev)
> INIT_LIST_HEAD(&private->crw);
> INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo);
> INIT_WORK(&private->crw_work, vfio_ccw_crw_todo);
> - init_completion(&private->release_comp);
>
> private->cp.guest_cp = kcalloc(CCWCHAIN_LEN_MAX, sizeof(struct ccw1),
> GFP_KERNEL);
> @@ -137,7 +136,7 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)
> struct vfio_ccw_private *private =
> container_of(vdev, struct vfio_ccw_private, vdev);
>
> - complete(&private->release_comp);
> + vfio_ccw_free_private(private);
> }
>
> static void vfio_ccw_mdev_remove(struct mdev_device *mdev)
> @@ -155,17 +154,6 @@ static void vfio_ccw_mdev_remove(struct mdev_device *mdev)
>
> dev_set_drvdata(&parent->dev, NULL);
> vfio_put_device(&private->vdev);
> - /*
> - * Wait for all active references on mdev are released so it
> - * is safe to defer kfree() to a later point.
> - *
> - * TODO: the clean fix is to split parent/mdev info from ccw
> - * private structure so each can be managed in its own life
> - * cycle.
> - */
> - wait_for_completion(&private->release_comp);
> -
> - vfio_ccw_free_private(private);
> }
>
> static int vfio_ccw_mdev_open_device(struct vfio_device *vdev)
> diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h
> index 747aba5f5272..2278fd38d34e 100644
> --- a/drivers/s390/cio/vfio_ccw_private.h
> +++ b/drivers/s390/cio/vfio_ccw_private.h
> @@ -102,7 +102,6 @@ struct vfio_ccw_parent {
> * @req_trigger: eventfd ctx for signaling userspace to return device
> * @io_work: work for deferral process of I/O handling
> * @crw_work: work for deferral process of CRW handling
> - * @release_comp: synchronization helper for vfio device release
> */
> struct vfio_ccw_private {
> struct vfio_device vdev;
> @@ -126,8 +125,6 @@ struct vfio_ccw_private {
> struct eventfd_ctx *req_trigger;
> struct work_struct io_work;
> struct work_struct crw_work;
> -
> - struct completion release_comp;
> } __aligned(8);
>
> int vfio_ccw_sch_quiesce(struct subchannel *sch);
Powered by blists - more mailing lists