[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250828123713.GA7333@nvidia.com>
Date: Thu, 28 Aug 2025 09:37:13 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: will@...nel.org, robin.murphy@....com, joro@...tes.org,
jean-philippe@...aro.org, miko.lenczewski@....com,
balbirs@...dia.com, peterz@...radead.org, smostafa@...gle.com,
kevin.tian@...el.com, praan@...gle.com, zhangzekun11@...wei.com,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH rfcv1 4/8] iommu/arm-smmu-v3: Introduce a per-domain
arm_smmu_invs array
On Wed, Aug 27, 2025 at 10:19:18AM -0700, Nicolin Chen wrote:
> > Just always do decr, then have a simple function to compact the list
> > after the decr:
>
> But the _dec function will always take the write lock, which seems
> to lose the benefit of using an RCU array?
The lock isn't needed, all it does is refcount dec which is atomic.
And all the lists are locked by the asid lock on the write side
anyhow.
> > If this returns NULL then just leave the list alone, it is OK to sit
> > there with the 0 users left behind.
>
> Yea, it's better than waiting for the next _add function to compact
> the list.
I was thinking you could call the add function with an empty list
instead of adding another function..
> > No need for the complex _del function and the _decr function..
> >
> > This also means the memory doesn't need to be preallocated and it
> > significantly simplifies alot of the logic.
>
> By "preallocated" you mean "master->scratch_invs"?
No, I mean the second list of invalidations the old domain new list.
Jason
Powered by blists - more mailing lists