From 92e3060c93f5fe780f28c4d72f71d64613cfb9e6 Mon Sep 17 00:00:00 2001 From: Zhen Lei Date: Fri, 3 Dec 2021 18:15:41 +0800 Subject: [PATCH] iommu: set the default iommu-dma mode as non-strict driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDAPXZ ---------------------------------------------------------------------- The non-strict smmu mode has significant performance gains and can resolve the nvme soft lockup problem. We enable it by default. Currently, many peripherals are faster than before. For example, the top speed of the older netcard is 10Gb/s, and now it's more than 25Gb/s. But when iommu page-table mapping enabled, it's hard to reach the top speed in strict mode, because of frequently map and unmap operations. In order to keep abreast of the times, I think it's better to set non-strict as default. Below it's our iperf performance data of 25Gb netcard: strict mode: 18-20 Gb/s non-strict mode: 23.5 Gb/s Signed-off-by: Zhen Lei Signed-off-by: Xie XiuQi Reviewed-by: Hanjun Guo Signed-off-by: Yang Yingliang Reviewed-by: Zhen Lei Acked-by: Xie XiuQi Reviewed-by: Cheng Jian Signed-off-by: Zheng Zengkai Signed-off-by: Qinxin Xia Signed-off-by: Hongye Lin --- Documentation/admin-guide/kernel-parameters.txt | 2 +- drivers/iommu/iommu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 90aae84c850a..d72ab64a69b9 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2294,7 +2294,7 @@ iommu.strict= [ARM64, X86, S390] Configure TLB invalidation behaviour Format: { "0" | "1" } - 0 - Lazy mode. + 0 - Lazy mode (default). Request that DMA unmap operations use deferred invalidation of hardware TLBs, for increased throughput at the cost of reduced device isolation. diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 4d76e3a6afaa..1a368a673de7 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -42,7 +42,7 @@ static DEFINE_IDA(iommu_group_ida); static DEFINE_IDA(iommu_global_pasid_ida); static unsigned int iommu_def_domain_type __read_mostly; -static bool iommu_dma_strict __read_mostly = IS_ENABLED(CONFIG_IOMMU_DEFAULT_DMA_STRICT); +static bool iommu_dma_strict __read_mostly; static u32 iommu_cmd_line __read_mostly; struct iommu_group { -- Gitee