[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44c5e07b-e663-5b96-a142-ec25666e2a14@huawei.com>
Date: Thu, 5 Aug 2021 16:16:02 +0100
From: John Garry <john.garry@...wei.com>
To: Robin Murphy <robin.murphy@....com>, <will@...nel.org>
CC: <joro@...tes.org>, <linux-arm-kernel@...ts.infradead.org>,
<iommu@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>,
<linuxarm@...wei.com>
Subject: Re: [PATCH] iommu/arm-smmu-v3: Remove some unneeded init in
arm_smmu_cmdq_issue_cmdlist()
On 05/08/2021 15:41, Robin Murphy wrote:
>> I suppose they could be combined into a smaller sub-struct and loaded
>> in a single operation, but it looks messy, and prob without much gain.
>
> Indeed I wouldn't say that saving memory is the primary concern here,
> and any more convoluted code is hardly going to help performance. Plus
> it still wouldn't help the other cases where we're just copying the size
> into a fake queue to do some prod arithmetic - I hadn't fully clocked
> what was going on there when I skimmed through things earlier.
>
> Disregarding the bogus layout change, though, do you reckon the rest of
> my idea makes sense?
I tried the similar change to avoid zero-init the padding in
arm_smmu_cmdq_write_entries() and the
_arm_smmu_cmdq_poll_set_valid_map(), but the disassembly was the same.
So the compiler must have got smart there.
But for the original change in this patch, it did make a difference.
It's nice to remove what was a memcpy:
1770: a9077eff stp xzr, xzr, [x23, #112]
}, head = llq;
1774: 94000000 bl 0 <memcpy>
And performance was very fractionally better.
As for pre-evaluating "nents", I'm not sure how much that can help, but
I am not too optimistic. I can try some testing when I get a chance.
Having said that, I would need to check the disassembly also.
Thanks,
John
Powered by blists - more mailing lists