Thread (37 messages) 37 messages, 2 authors, 2026-01-27

Re: [PATCH v2 04/10] iommu/arm-smmu-v3: Allocate IOTLB cache tag if no id to reuse

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2026-01-27 16:29:12
Also in: linux-iommu, linux-patches, lkml

On Mon, Jan 26, 2026 at 02:23:36PM -0800, Nicolin Chen wrote:
On Mon, Jan 26, 2026 at 05:06:40PM -0400, Jason Gunthorpe wrote:
quoted
On Wed, Jan 21, 2026 at 05:24:22PM -0800, Nicolin Chen wrote:
quoted
@@ -3220,6 +3241,9 @@ arm_smmu_master_build_inv(struct arm_smmu_master *master,
 		break;
 	}
 
+	/* Set a default users counter */
+	refcount_set(&cur->users, 1);
I think abusing users here is a little too hard to read..

Can we just keep track in the state somehow with a flag?

Or maybe union in a "bool needs_free" that is for the on-stack version
of this structure?
This doesn't only apply to the case when a tag is newly allocated
during the attach, but it can be used when an old tag has users=0
during a detach, right?
Oh, IDK, I didn't look so closely..

I though this was just about cleaning up the tag during attach, the
detach flow worked differently and did use users = 0?

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help