[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250506172932.GA33739@ziepe.ca>
Date: Tue, 6 May 2025 14:29:32 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Lu Baolu <baolu.lu@...ux.intel.com>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Kevin Tian <kevin.tian@...el.com>, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] iommu/vt-d: Use ida to manage domain id
On Wed, Apr 30, 2025 at 10:11:34AM +0800, Lu Baolu wrote:
> Switch the intel iommu driver to use the ida mechanism for managing domain
> IDs, replacing the previous fixed-size bitmap.
>
> The previous approach allocated a bitmap large enough to cover the maximum
> number of domain IDs supported by the hardware, regardless of the actual
> number of domains in use. This led to unnecessary memory consumption,
> especially on systems supporting a large number of iommu units but only
> utilizing a small number of domain IDs.
>
> The ida allocator dynamically manages the allocation and freeing of integer
> IDs, only consuming memory for the IDs that are currently in use. This
> significantly optimizes memory usage compared to the fixed-size bitmap.
>
> Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
> Reviewed-by: Kevin Tian <kevin.tian@...el.com>
> ---
> drivers/iommu/intel/dmar.c | 3 ++
> drivers/iommu/intel/iommu.c | 80 ++++++++-----------------------------
> drivers/iommu/intel/iommu.h | 19 +++++++--
> 3 files changed, 34 insertions(+), 68 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists