[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230811130246.42719-1-zhangzekun11@huawei.com>
Date: Fri, 11 Aug 2023 21:02:44 +0800
From: Zhang Zekun <zhangzekun11@...wei.com>
To: <robin.murphy@....com>, <joro@...tes.org>, <will@...nel.org>
CC: <iommu@...ts.linux.dev>, <linux-kernel@...r.kernel.org>,
<baolu.lu@...ux.intel.com>, <robh@...nel.org>,
<nicolinc@...dia.com>, <john.g.garry@...cle.com>,
<kevin.tian@...el.com>
Subject: [RESEND PATCH 0/2] iommu/iova: optimize the iova rcache
The number of iova_cpu_rcache can grow with the number of cpus in
iova_rcache, but the size of rcache->depot will not. The deeper of
rcache->depot can help iova_rcache cache more iovas, and can help
iova_rcache better dealing with senarios in which drivers allocating
and free iovas on different cpu cores. We only let the size of rcache->depot
to grow with the number of cpus which is larger than 32 to avoid potential
performance decrease on machines which don't have much cpus.
Also, it is unsafe to directly free cpu rcache magazines in free_iova_rcaches,
add check before freeing it.
Zhang Zekun (2):
iommu/iova: Add check for cpu_rcache in free_iova_rcaches
iommu/iova: allocate iova_rcache->depot dynamicly
drivers/iommu/iova.c | 36 +++++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
--
2.17.1
Powered by blists - more mailing lists