iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iommu/iova: enhance the rcache optimization
@ 2019-08-15 12:11 Zhen Lei
  2019-08-15 12:11 ` [PATCH v2 1/2] iommu/iova: introduce iova_magazine_compact_pfns() Zhen Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhen Lei @ 2019-08-15 12:11 UTC (permalink / raw)
  To: Jean-Philippe Brucker, Jean-Philippe Brucker, John Garry,
	Robin Murphy, Will Deacon, Joerg Roedel, iommu, Omer Peleg,
	Adam Morrison, Shaohua Li, Ben Serebrin, David Woodhouse,
	linux-arm-kernel, linux-kernel

v1 --> v2
1. I did not chagne the patches but added this cover-letter.
2. Add a batch of reviewers base on
   9257b4a206fc ("iommu/iova: introduce per-cpu caching to iova allocation")
3. I described the problem I met in patch 2, but I hope below brief description
   can help people to quickly understand.
   Suppose there are six rcache sizes, each size can maximum hold 10000 IOVAs.
   --------------------------------------------
   |  4K   |  8K  | 16K  |  32K | 64K  | 128K |
   --------------------------------------------
   | 10000 | 9000 | 8500 | 8600 | 9200 | 7000 |
   --------------------------------------------
   As the above map displayed, the whole rcache buffered too many IOVAs. Now, the
   worst case can be coming, suppose we need 20000 4K IOVAs at one time. That means
   10000 IOVAs can be allocated from rcache, but another 10000 IOVAs should be 
   allocated from RB tree base on alloc_iova() function. But the RB tree currently
   have at least (9000 + 8500 + 8600 + 9200 + 7000) = 42300 nodes. The average speed
   of RB tree traverse will be very slow. For my test scenario, the 4K size IOVAs are
   frequently used, but others are not. So similarly, when the 20000 4K IOVAs are
   continuous freed, the first 10000 IOVAs can be quickly buffered, but the other
   10000 IOVAs can not.

Zhen Lei (2):
  iommu/iova: introduce iova_magazine_compact_pfns()
  iommu/iova: enhance the rcache optimization

 drivers/iommu/iova.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++----
 include/linux/iova.h |   1 +
 2 files changed, 95 insertions(+), 6 deletions(-)

-- 
1.8.3


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2019-08-23  8:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 12:11 [PATCH v2 0/2] iommu/iova: enhance the rcache optimization Zhen Lei
2019-08-15 12:11 ` [PATCH v2 1/2] iommu/iova: introduce iova_magazine_compact_pfns() Zhen Lei
2019-08-15 12:11 ` [PATCH v2 2/2] iommu/iova: enhance the rcache optimization Zhen Lei
2019-08-23  8:15 ` [PATCH v2 0/2] " Leizhen (ThunderTown)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).