[PATCH] iommu/arm-smmu-v3: Change vmid alloc strategy from bitmap to ida

Jason Gunthorpe jgg at ziepe.ca
Tue Jul 25 06:41:59 PDT 2023


On Sun, Jul 16, 2023 at 12:16:21AM +0800, Dawei Li wrote:
> For current implementation of vmid allocation of arm smmu-v3, a per-smmu
> devide bitmap of 64K bits(8K bytes) is allocated on behalf of possible VMID
> range, which is two pages for some architectures. Besides that, its memory
> consumption is 'static', despite of how many VMIDs are allocated actually.

Is there an actual problem here? Allocating a single 8k page at early
boot doesn't seem like a burden? Are there alot of smmu instances?

> So an IDA based implementation is introduced to address this issue, which
> is capable of self-expanding on the actual need of VMID allocation.

However, I agree IDA is just generally better and generally drivers
shouldn't be open coding it

Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>

Jason



More information about the linux-arm-kernel mailing list