[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81258eb7-eb73-8a32-0983-3487daba1167@arm.com>
Date: Fri, 13 Aug 2021 17:01:38 +0100
From: Robin Murphy <robin.murphy@....com>
To: Zhen Lei <thunder.leizhen@...wei.com>,
Will Deacon <will@...nel.org>, Joerg Roedel <joro@...tes.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
iommu <iommu@...ts.linux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] iommu/arm-smmu-v3: Use command queue batching helpers
to improve performance
On 2021-08-11 12:48, Zhen Lei wrote:
> The obvious key to the performance optimization of commit 587e6c10a7ce
> ("iommu/arm-smmu-v3: Reduce contention during command-queue insertion") is
> to allow multiple cores to insert commands in parallel after a brief mutex
> contention.
>
> Obviously, inserting as many commands at a time as possible can reduce the
> number of times the mutex contention participates, thereby improving the
> overall performance. At least it reduces the number of calls to function
> arm_smmu_cmdq_issue_cmdlist().
>
> Therefore, use command queue batching helpers to insert multiple commands
> at a time.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index 235f9bdaeaf223b..c81cd929047f573 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -1747,15 +1747,16 @@ static int arm_smmu_atc_inv_master(struct arm_smmu_master *master)
> {
> int i;
> struct arm_smmu_cmdq_ent cmd;
> + struct arm_smmu_cmdq_batch cmds = {};
BTW, it looks like this has crossed over with John's patch removing these.
Robin.
>
> arm_smmu_atc_inv_to_cmd(0, 0, 0, &cmd);
>
> for (i = 0; i < master->num_streams; i++) {
> cmd.atc.sid = master->streams[i].id;
> - arm_smmu_cmdq_issue_cmd(master->smmu, &cmd);
> + arm_smmu_cmdq_batch_add(master->smmu, &cmds, &cmd);
> }
>
> - return arm_smmu_cmdq_issue_sync(master->smmu);
> + return arm_smmu_cmdq_batch_submit(master->smmu, &cmds);
> }
>
> int arm_smmu_atc_inv_domain(struct arm_smmu_domain *smmu_domain, int ssid,
>
Powered by blists - more mailing lists