Unverified Commit a711cdaf authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3320 Make the rcache depot scale better

Merge Pull Request from: @ci-robot 
 
PR sync from: Zhang Zekun <zhangzekun11@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/IZ5NKOTTMTI6SR3WLRBGI4RKB2PE7QUF/ 
Recently we have meet a problem when running FIO test.
In our kunpeng server with 320 cores, about 80% cpus comes to-
100% usage, and soft lockup appears in the kernel message,
which shows it stuck in __alloc_and_insert_iova_range().
Both the call trace and high cpu occupy rate implys that the
iova_rcache behaves poorly to alloc iovas.

A similar problem has been addressed in early months this year,
the solution is just to enlarge the MAX_GLOBAL_MAGS to 128, but
it requires to growth with the cpu cores, and it is hard to set
a accurate val for a specific machine. So, it is better to
use solutions from the linux community, use a list to replace
the array of iova_rcache->depot. It will push iova_magazine
to depot list when the local cpu_rcache is full, and use
schedul_delayed_work() to free it after 100ms. The minimum length
of the depot list is the num of online_cpus().

The performance of this patch shows good. This patch set use a
lot of timers to record the iova_magazine, and the delay of timers
in system may increase when undering heavy work load, but
it should not cause problem as timers itself allows a inaccurate
delay for a range.

v2:
- change a comment in patch 5/6, no code change.

We need to merge "iommu/iova: change IOVA_MAG_SIZE to 127 to save
memory" first to resolve a compile error:

error: static assertion failed: "!(sizeof(struct iova_magazine) & (sizeof(struct iova_magazine) - 1))"

Feng Tang (1):
  iommu/iova: change IOVA_MAG_SIZE to 127 to save memory

Zhang Zekun (5):
  Revert "iommu/iova: move IOVA_MAX_GLOBAL_MAGS outside of
    IOMMU_SUPPORT"
  Revert "config: enable set the max iova mag size to 128"
  Revert "iommu/iova: increase the iova_rcache depot max size to 128"
  iommu/iova: Make the rcache depot scale better
  iommu/iova: Manage the depot list size


-- 
2.17.1
 
https://gitee.com/openeuler/kernel/issues/I8KS9A 
 
Link:https://gitee.com/openeuler/kernel/pulls/3320

 

Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 08b1347b 4dfc6967
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment