* [PATCH] iommufd: Remove iommufd_ref_to_users()
@ 2023-08-14 23:24 Jason Gunthorpe
2023-08-15 2:48 ` Tian, Kevin
2023-08-15 14:45 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2023-08-14 23:24 UTC (permalink / raw)
To: iommu; +Cc: Kevin Tian
This no longer has any callers, remove the function
Kevin noticed that after commit 99f98a7c0d69 ("iommufd: IOMMUFD_DESTROY
should not increase the refcount") there was only one other user and it
turns out the rework in commit 9227da7816dd ("iommufd: Add
iommufd_access_change_ioas(_id) helpers") got rid of the last one.
Suggested-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
drivers/iommu/iommufd/iommufd_private.h | 23 -----------------------
1 file changed, 23 deletions(-)
This is possible once the rc branch is merged up with iommufd to join the two
commits.
diff --git a/drivers/iommu/iommufd/iommufd_private.h b/drivers/iommu/iommufd/iommufd_private.h
index 15596a08a0571e..5a45b8ba2e26cb 100644
--- a/drivers/iommu/iommufd/iommufd_private.h
+++ b/drivers/iommu/iommufd/iommufd_private.h
@@ -149,29 +149,6 @@ static inline void iommufd_put_object(struct iommufd_object *obj)
up_read(&obj->destroy_rwsem);
}
-/**
- * iommufd_ref_to_users() - Switch from destroy_rwsem to users refcount
- * protection
- * @obj - Object to release
- *
- * Objects have two refcount protections (destroy_rwsem and the refcount_t
- * users). Holding either of these will prevent the object from being destroyed.
- *
- * Depending on the use case, one protection or the other is appropriate. In
- * most cases references are being protected by the destroy_rwsem. This allows
- * orderly destruction of the object because iommufd_object_destroy_user() will
- * wait for it to become unlocked. However, as a rwsem, it cannot be held across
- * a system call return. So cases that have longer term needs must switch
- * to the weaker users refcount_t.
- *
- * With users protection iommufd_object_destroy_user() will return false,
- * refusing to destroy the object, causing -EBUSY to userspace.
- */
-static inline void iommufd_ref_to_users(struct iommufd_object *obj)
-{
- up_read(&obj->destroy_rwsem);
- /* iommufd_lock_obj() obtains users as well */
-}
void iommufd_object_abort(struct iommufd_ctx *ictx, struct iommufd_object *obj);
void iommufd_object_abort_and_destroy(struct iommufd_ctx *ictx,
struct iommufd_object *obj);
base-commit: 83f968d8ba18e550acaef6921bf64cffe672df82
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] iommufd: Remove iommufd_ref_to_users()
2023-08-14 23:24 [PATCH] iommufd: Remove iommufd_ref_to_users() Jason Gunthorpe
@ 2023-08-15 2:48 ` Tian, Kevin
2023-08-15 14:45 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Tian, Kevin @ 2023-08-15 2:48 UTC (permalink / raw)
To: Jason Gunthorpe, iommu@lists.linux.dev
> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Tuesday, August 15, 2023 7:25 AM
>
> This no longer has any callers, remove the function
>
> Kevin noticed that after commit 99f98a7c0d69 ("iommufd:
> IOMMUFD_DESTROY
> should not increase the refcount") there was only one other user and it
> turns out the rework in commit 9227da7816dd ("iommufd: Add
> iommufd_access_change_ioas(_id) helpers") got rid of the last one.
>
> Suggested-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iommufd: Remove iommufd_ref_to_users()
2023-08-14 23:24 [PATCH] iommufd: Remove iommufd_ref_to_users() Jason Gunthorpe
2023-08-15 2:48 ` Tian, Kevin
@ 2023-08-15 14:45 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2023-08-15 14:45 UTC (permalink / raw)
To: iommu; +Cc: Kevin Tian
On Mon, Aug 14, 2023 at 08:24:34PM -0300, Jason Gunthorpe wrote:
> This no longer has any callers, remove the function
>
> Kevin noticed that after commit 99f98a7c0d69 ("iommufd: IOMMUFD_DESTROY
> should not increase the refcount") there was only one other user and it
> turns out the rework in commit 9227da7816dd ("iommufd: Add
> iommufd_access_change_ioas(_id) helpers") got rid of the last one.
>
> Suggested-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/iommu/iommufd/iommufd_private.h | 23 -----------------------
> 1 file changed, 23 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-15 14:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 23:24 [PATCH] iommufd: Remove iommufd_ref_to_users() Jason Gunthorpe
2023-08-15 2:48 ` Tian, Kevin
2023-08-15 14:45 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox