mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND PATCH 0/2] iommu/iova: optimize the iova rcache
@ 2023-08-11 13:02 Zhang Zekun
  2023-08-11 13:02 ` [RESEND PATCH 1/2] iommu/iova: Add check for cpu_rcache in free_iova_rcaches Zhang Zekun
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Zhang Zekun @ 2023-08-11 13:02 UTC (permalink / raw)
  To: robin.murphy, joro, will
  Cc: iommu, linux-kernel, baolu.lu, robh, nicolinc, john.g.garry, kevin.tian

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-08-16  3:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 13:02 [RESEND PATCH 0/2] iommu/iova: optimize the iova rcache Zhang Zekun
2023-08-11 13:02 ` [RESEND PATCH 1/2] iommu/iova: Add check for cpu_rcache in free_iova_rcaches Zhang Zekun
2023-08-11 13:32   ` Robin Murphy
2023-08-12  2:21     ` zhangzekun (A)
2023-08-11 13:02 ` [RESEND PATCH 2/2] iommu/iova: allocate iova_rcache->depot dynamicly Zhang Zekun
2023-08-11 14:14   ` John Garry
2023-08-12  7:18     ` zhangzekun (A)
2023-08-15 15:15       ` John Garry
2023-08-16  3:40         ` zhangzekun (A)
2023-08-11 13:25 ` [RESEND PATCH 0/2] iommu/iova: optimize the iova rcache Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®