[PATCH v7 10/11] iommu/arm-smmu-v3: Invoke pm_runtime before hw access
Nicolin Chen
nicolinc at nvidia.com
Thu May 28 15:01:13 PDT 2026
On Thu, May 28, 2026 at 09:46:33PM +0000, Pranjal Shrivastava wrote:
> On Thu, May 28, 2026 at 01:28:15PM -0700, Nicolin Chen wrote:
> > On Wed, May 27, 2026 at 10:14:06PM +0000, Pranjal Shrivastava wrote:
> > > TLB and CFG invalidations are
> > > elided if the SMMU is suspended by observing the CMDQ_PROD_STOP_FLAG via
> > > the arm_smmu_can_elide() helper.
> >
> > All the arm_smmu_can_elide() call sites here would eventually elide
> > the commands in arm_smmu_cmdq_issue_cmdlist() that is already gated
> > by CMDQ_PROD_STOP_FLAG? It doesn't seem necessary to gate again?
>
> While issue_cmdlist() would eventually elide these commands, the
> can_elide() check is necessary to return early during suspension.
>
> This avoids unnecessary stack allocation, cmd building, and spinlock
> contention on the cmdq->lock for threads that are anyway about to be
> elided.
We aren't in the perf sensitive path.. most of those aren't going
to be that bad.
arm_smmu_cmdq_shared_lock() on the other hand is taken at step 2,
and the STOP flag in the same function is gated at step 1?
> By dropping these requests immediately, we significantly reduce cacheline
> bouncing and contention during unmap storms.
How significantly, so as to justify invading every command issue()
call site, which would be difficult to maintain? If we really need
an early return, it would be nicer to have a common place at least.
> Furthermore, the early check
> also allows us to specifically trigger the WARN_ON_ONCE() for broken
> devlinks.
This doesn't sound very appealing to me.. And even if there is a
very plausible reason, it should be noted in the commit message.
Nicolin
More information about the linux-arm-kernel
mailing list